-
Notifications
You must be signed in to change notification settings - Fork 0
Fix change-verb regression + collapse doubled articles #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7812edc
1d084c9
6cc6554
af64307
f9451a6
95e7d81
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| { | ||
| "name": "AI Humanizer", | ||
| "short_name": "Humanizer", | ||
| "description": "Rewrite machine-sounding text into a human tone — perplexity, burstiness and lexical, by tone. Runs entirely on your device.", | ||
| "id": "./", | ||
| "start_url": "./", | ||
| "scope": "./", | ||
| "display": "standalone", | ||
| "orientation": "any", | ||
| "background_color": "#0e1117", | ||
| "theme_color": "#0e1117", | ||
| "icons": [ | ||
| { "src": "./icons/icon-192.png", "sizes": "192x192", "type": "image/png", "purpose": "any" }, | ||
| { "src": "./icons/icon-512.png", "sizes": "512x512", "type": "image/png", "purpose": "any" }, | ||
| { "src": "./icons/icon-maskable-512.png", "sizes": "512x512", "type": "image/png", "purpose": "maskable" } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| /* Service worker: makes the app installable and work offline. | ||
| Strategy: precache the app shell + the humanizer package, then | ||
| cache-first with network fallback for everything else (incl. the | ||
| Pyodide runtime from the CDN, cached opportunistically on first use). */ | ||
|
|
||
| const CACHE = "humanizer-v1"; | ||
| const SHELL = [ | ||
| "./", | ||
| "./index.html", | ||
| "./styles.css", | ||
| "./app.js", | ||
| "./manifest.webmanifest", | ||
| "./icons/icon-192.png", | ||
| "./icons/icon-512.png", | ||
| "./icons/icon-maskable-512.png", | ||
| "./icons/apple-touch-icon.png", | ||
| ]; | ||
|
|
||
| self.addEventListener("install", (event) => { | ||
| event.waitUntil( | ||
| (async () => { | ||
| const cache = await caches.open(CACHE); | ||
| await cache.addAll(SHELL).catch(() => {}); | ||
| // Also precache the Python package files listed in the manifest. | ||
| try { | ||
| const list = await (await fetch("./humanizer/__files__.json", { cache: "no-cache" })).json(); | ||
| await cache.addAll( | ||
| ["./humanizer/__files__.json", ...list.map((f) => "./humanizer/" + f)] | ||
| ); | ||
| } catch (e) {} | ||
| self.skipWaiting(); | ||
| })() | ||
| ); | ||
| }); | ||
|
|
||
| self.addEventListener("activate", (event) => { | ||
| event.waitUntil( | ||
| (async () => { | ||
| const keys = await caches.keys(); | ||
| await Promise.all(keys.filter((k) => k !== CACHE).map((k) => caches.delete(k))); | ||
| await self.clients.claim(); | ||
| })() | ||
| ); | ||
| }); | ||
|
|
||
| self.addEventListener("fetch", (event) => { | ||
| const req = event.request; | ||
| if (req.method !== "GET") return; | ||
| event.respondWith( | ||
| (async () => { | ||
| const cached = await caches.match(req); | ||
| if (cached) return cached; | ||
|
Comment on lines
+51
to
+52
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
With a fixed Useful? React with 👍 / 👎. |
||
| try { | ||
| const res = await fetch(req); | ||
| // Cache successful or opaque (cross-origin CDN) responses. | ||
| if (res && (res.ok || res.type === "opaque")) { | ||
| const cache = await caches.open(CACHE); | ||
| cache.put(req, res.clone()).catch(() => {}); | ||
| } | ||
| return res; | ||
| } catch (e) { | ||
| // Offline and not cached: fall back to the app shell for navigations. | ||
| if (req.mode === "navigate") { | ||
| const shell = await caches.match("./index.html"); | ||
| if (shell) return shell; | ||
| } | ||
| throw e; | ||
| } | ||
| })() | ||
| ); | ||
| }); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -96,7 +96,7 @@ | |
| 'drew to a close', | ||
| 'came to an end'], | ||
| 'finish': ['complete', 'wrap up', 'round off', 'conclude', 'close out'], | ||
| 'change': ['shift', 'transition', 'adjustment', 'alteration', 'transformation'], | ||
| 'change': ['alter', 'adjust', 'modify', 'revise', 'shift', 'tweak', 'rework', 'reshape'], | ||
| 'changed': ['shifted', 'altered', 'adjusted', 'modified', 'reshaped'], | ||
| 'improve': ['sharpen', 'strengthen', 'refine', 'upgrade', 'boost', 'enhance'], | ||
| 'improved': ['sharpened', 'strengthened', 'refined', 'upgraded', 'boosted'], | ||
|
|
@@ -1063,7 +1063,7 @@ | |
| 'options': ['choices', 'alternatives', 'possibilities', 'routes', 'avenues', 'ways forward'], | ||
| 'decision': ['choice', 'call', 'ruling', 'verdict', 'determination'], | ||
| 'decisions': ['choices', 'calls', 'rulings', 'verdicts', 'determinations', 'rulings made'], | ||
| 'changes': ['shifts', 'transitions', 'adjustments', 'alterations', 'overhauls', 'tweaks'], | ||
| 'changes': ['alters', 'adjusts', 'modifies', 'revises', 'shifts', 'reworks', 'reshapes', 'tweaks'], | ||
| 'future': ['years ahead', | ||
| 'time to come', | ||
| 'road ahead', | ||
|
|
@@ -1294,7 +1294,7 @@ | |
| 'support': ['corroborate', 'buttress', 'underpin', 'substantiate'], | ||
| 'increase': ['augment', 'amplify', 'elevate', 'intensify'], | ||
| 'decrease': ['attenuate', 'diminish', 'abate', 'curtail'], | ||
| 'change': ['modification', 'alteration', 'perturbation', 'variation'], | ||
| 'change': ['alter', 'modify', 'revise', 'recalibrate', 'adjust'], | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The lexical pass does not do POS tagging, so this verb-only override also fires when Useful? React with 👍 / 👎. |
||
| 'cause': ['give rise to', 'engender', 'precipitate', 'induce'], | ||
| 'affect': ['bear upon', 'modulate', 'influence', 'condition'], | ||
| 'effect': ['effect size', 'consequence', 'ramification', 'outcome'], | ||
|
|
@@ -1580,7 +1580,7 @@ | |
| 'great': ['awesome', 'killer', 'amazing', 'epic'], | ||
| 'easy': ['a breeze', 'no sweat', 'simple', 'easy-peasy'], | ||
| 'hard': ['tough', 'tricky', 'a pain', 'rough'], | ||
| 'change': ['switch-up', 'shake-up', 'tweak', 'shift'], | ||
| 'change': ['switch up', 'shake up', 'tweak', 'mix up', 'redo'], | ||
| 'increase': ['bump up', 'boost', 'crank up', 'ramp up'], | ||
| 'decrease': ['cut down', 'trim', 'knock back', 'scale back'], | ||
| 'problem': ['snag', 'hiccup', 'headache', 'issue'], | ||
|
|
@@ -1808,7 +1808,7 @@ | |
| 'great': ['outstanding', 'exceptional', 'first-rate', 'stellar'], | ||
| 'easy': ['simple', 'effortless', 'well within reach', 'clear-cut'], | ||
| 'hard': ['demanding', 'no small task', 'a real test', 'tough'], | ||
| 'change': ['a decisive shift', 'transformation', 'overhaul', 'pivot'], | ||
| 'change': ['overhaul', 'revamp', 'transform', 'redefine', 'reshape'], | ||
| 'increase': ['drive up', 'scale up', 'accelerate', 'push higher'], | ||
| 'decrease': ['slash', 'cut decisively', 'drive down', 'reduce hard'], | ||
| 'problem': ['obstacle', 'hurdle to clear', 'challenge', 'roadblock'], | ||
|
|
@@ -2036,7 +2036,7 @@ | |
| 'great': ['wonderful', 'lovely', 'heartening', 'uplifting'], | ||
| 'easy': ['gentle', 'manageable', 'doable', 'light'], | ||
| 'hard': ["hard, and that's okay", 'tough', 'heavy', 'trying'], | ||
| 'change': ['a gentle shift', 'a transition', 'a new chapter', 'growth'], | ||
| 'change': ['gently adjust', 'rework', 'reshape', 'revisit', 'soften'], | ||
| 'increase': ['gently grow', 'build up', 'nurture upward', 'lift'], | ||
| 'decrease': ['gently reduce', 'ease back', 'lighten', 'soften'], | ||
| 'problem': ['struggle', 'hardship', 'rough patch', 'difficulty'], | ||
|
|
@@ -2264,7 +2264,7 @@ | |
| 'great': ['fantastic', 'wonderful', 'brilliant', 'terrific'], | ||
| 'easy': ['simple', 'a breeze', 'no trouble', 'easy-peasy'], | ||
| 'hard': ['tricky', 'tough', 'a bit of a challenge', 'fiddly'], | ||
| 'change': ['a switch', 'a tweak', 'a fresh take', 'an update'], | ||
| 'change': ['switch up', 'tweak', 'update', 'tidy up', 'rework'], | ||
| 'increase': ['boost', 'bump up', 'grow', 'build up'], | ||
| 'decrease': ['cut back', 'trim', 'scale back', 'ease off'], | ||
| 'problem': ['snag', 'hiccup', 'little issue', 'bump'], | ||
|
|
@@ -2492,7 +2492,7 @@ | |
| 'great': ['remarkable', 'game-changing', 'outstanding', 'powerful'], | ||
| 'easy': ['effortless', 'simple', 'frictionless', 'painless'], | ||
| 'hard': ['a real challenge worth facing', 'tough but worth it'], | ||
| 'change': ['a transformation', 'a breakthrough shift', 'a turning point'], | ||
| 'change': ['transform', 'overhaul', 'revolutionize', 'reinvent', 'supercharge'], | ||
| 'increase': ['maximize', 'skyrocket', 'supercharge', 'multiply'], | ||
| 'decrease': ['slash', 'eliminate the waste', 'cut sharply', 'wipe out'], | ||
| 'problem': ['pain point', 'costly issue', 'barrier', 'weakness'], | ||
|
|
@@ -2720,7 +2720,7 @@ | |
| 'great': ['excellent', 'outstanding', 'high-caliber', 'exceptional'], | ||
| 'easy': ['straightforward', 'low-effort', 'streamlined', 'manageable'], | ||
| 'hard': ['complex', 'demanding', 'challenging', 'involved'], | ||
| 'change': ['a transition', 'a transformation', 'a realignment', 'a shift'], | ||
| 'change': ['adjust', 'realign', 'revise', 'restructure', 'recalibrate'], | ||
| 'increase': ['increase', 'scale', 'expand', 'grow'], | ||
| 'decrease': ['reduce', 'scale back', 'contract', 'trim'], | ||
| 'problem': ['issue', 'risk', 'blocker', 'challenge'], | ||
|
|
@@ -2948,7 +2948,7 @@ | |
| 'great': ['magnificent', 'glorious', 'splendid', 'wondrous'], | ||
| 'easy': ['effortless', 'smooth', 'untroubled', 'light'], | ||
| 'hard': ['grueling', 'arduous', 'punishing', 'uphill'], | ||
| 'change': ['a turning point', 'an upheaval', 'a sea change', 'a twist'], | ||
| 'change': ['upend', 'transform', 'reshape', 'unravel', 'rewrite'], | ||
| 'increase': ['swell', 'mount', 'surge', 'climb'], | ||
| 'decrease': ['dwindle', 'ebb', 'wane', 'shrink away'], | ||
| 'problem': ['trouble', 'predicament', 'plight', 'thorn'], | ||
|
|
@@ -3176,7 +3176,7 @@ | |
| 'great': ['objectively flawless', 'stupendous, allegedly', 'epic'], | ||
| 'easy': ['deceptively simple', 'suspiciously easy', "child's play"], | ||
| 'hard': ['heroically difficult', 'comically hard', 'an ordeal'], | ||
| 'change': ['a plot twist', 'an unexpected pivot', 'a curveball'], | ||
| 'change': ['shake up', 'flip', 'reinvent', 'spin', 'overhaul'], | ||
| 'increase': ['inflate dramatically', 'balloon', 'spike, naturally'], | ||
| 'decrease': ['nosedive', 'plummet, dramatically', 'evaporate'], | ||
| 'problem': ['calamity', 'fiasco', 'debacle', 'kerfuffle'], | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because registration is deferred until
window.load, andindex.htmlloads the CDNpyodide.jsscript beforeapp.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 👍 / 👎.