Skip to content

Fix change-verb regression + collapse doubled articles#3

Merged
CarlosA49 merged 6 commits into
mainfrom
claude/ai-humanizer-tool-DPX66
May 17, 2026
Merged

Fix change-verb regression + collapse doubled articles#3
CarlosA49 merged 6 commits into
mainfrom
claude/ai-humanizer-tool-DPX66

Conversation

@CarlosA49

Copy link
Copy Markdown
Owner

Summary

Follow-up to PR #2 (merged). PR #2 was merged at c70307b, just before
these fixes, so main currently has the regression the automated review
flagged. This lands the fix.

  • change verb regression: the expanded dictionary gave change,
    changes, and the per-tone overrides for all 9 tones noun-only
    alternatives, so "change the plan" → "transformation the plan". Restored
    verb-form, tone-flavoured replacements everywhere
    (professional → "realign the strategy", academic → "modify the strategy",
    witty → "flip the grand scheme", …).
  • Doubled articles: the expansion left ~1,400 article-led phrase values
    (e.g. plan → "the strategy"); when the original word already had an
    article this produced "the the strategy". Hardened _fix_articles to
    collapse a doubled article, preserving capitalization and a/an agreement.
    The curated phrases are intentionally left intact.

Validation

  • python -m py_compile clean; every tone still ≥ 3,000 effective synonyms.
  • Full suite: 41 tests pass.
  • Demos confirm grammatical output across tones.

Test plan

  • PR test check green
  • deploy check green now that the repo is public and Pages source =
    "GitHub Actions" (then the site/PWA is live at
    https://carlosa49.github.io/Humanizer-tester/)
  • Spot-check "change the plan" across a few tones

https://claude.ai/code/session_015REKyF6JmJchTnZWoLth7Y


Generated by Claude Code

claude added 5 commits May 17, 2026 02:13
PWA: web app manifest, offline service worker (precaches the app shell and
the humanizer package, caches Pyodide on first use), iOS meta tags and
apple-touch-icon, and placeholder app icons (192/512/maskable/180). Users
can Add to Home Screen for a full-screen, offline, deletable/re-addable app
with no app store. Adds ios/ — a SwiftUI WKWebView wrapper plus a complete
build/submit plan for a future native App Store listing. README documents
install steps for iOS/Android/desktop.

https://claude.ai/code/session_015REKyF6JmJchTnZWoLth7Y
Leads with Open/Install badges and a per-device Add-to-Home-Screen table so
anyone landing on the repo can install the app from the live link in seconds.

https://claude.ai/code/session_015REKyF6JmJchTnZWoLth7Y
Review feedback on PR #2: expanded dictionaries gave `change` (and the
per-tone overrides + `changes`) noun-only alternatives, so "change the plan"
became "transformation the plan". Restore verb-form, tone-flavoured
replacements for change/changes across BASE and all 9 tones.

Also harden _fix_articles to collapse a doubled article introduced when a
single word is replaced by an article-led phrase ("the the strategy" ->
"the strategy"), preserving capitalization and a/an agreement. All 41 tests
pass.

https://claude.ai/code/session_015REKyF6JmJchTnZWoLth7Y
Repo visibility changed to public, so GitHub Pages can now be enabled and
the deploy job (configure-pages with enablement: true) should succeed.

https://claude.ai/code/session_015REKyF6JmJchTnZWoLth7Y
A ~2s deploy-job failure on feature branches was GitHub's github-pages
environment protection rejecting deployments from a non-default branch.
Gate the deploy job with if: github.ref == 'refs/heads/main' so it is
skipped (not failed) on branches and runs for real once merged to main,
where the environment permits it and the Pages source is GitHub Actions.

https://claude.ai/code/session_015REKyF6JmJchTnZWoLth7Y

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f9451a6390

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/app.js
Comment on lines +155 to +157
if ("serviceWorker" in navigator) {
window.addEventListener("load", () => {
navigator.serviceWorker.register("./sw.js").catch(() => {});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Register the service worker before loading Pyodide

Because registration is deferred until window.load, and index.html loads the CDN pyodide.js script before app.js, the service worker cannot see or cache that required runtime during a user's first visit. In a fresh install, going offline immediately after the first successful open can leave the PWA unable to reload because the top-level Pyodide script was never placed in the app cache; register earlier or explicitly precache the runtime URLs before advertising first-open offline support.

Useful? React with 👍 / 👎.

Comment thread docs/sw.js
Comment on lines +51 to +52
const cached = await caches.match(req);
if (cached) return cached;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Revalidate cached assets after deployments

With a fixed humanizer-v1 cache and this cache-first return, anyone who has opened the PWA keeps receiving the old app.js, humanizer/__files__.json, and package files after a later GitHub Pages deploy unless sw.js/CACHE is also changed. That means future dictionary or core fixes can be invisible to installed users even though the README/iOS wrapper says site updates are picked up automatically; use revisioned cache names/generated manifests or a network-first/stale-while-revalidate path for these app assets.

Useful? React with 👍 / 👎.

Comment thread humanizer/dictionaries.py
'increase': ['augment', 'amplify', 'elevate', 'intensify'],
'decrease': ['attenuate', 'diminish', 'abate', 'curtail'],
'change': ['modification', 'alteration', 'perturbation', 'variation'],
'change': ['alter', 'modify', 'revise', 'recalibrate', 'adjust'],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve noun-safe replacements for change

The lexical pass does not do POS tagging, so this verb-only override also fires when change is a noun; for example, academic tone can turn We need a change into we demand a reshape/a revise. The previous values were noun phrases, so this introduces ungrammatical output for common noun contexts while fixing imperative verb contexts; keeping alternatives that work as both nouns and verbs or handling noun forms separately would avoid trading one regression for another.

Useful? React with 👍 / 👎.

@CarlosA49 CarlosA49 merged commit 50f4e85 into main May 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants