Add missing -ize/-ise words and fix two reversed word-list entries - #284
Merged
Conversation
SubtitleEdit/subtitleedit#13583 reports "fantasize" not being converted. The word list only covered 66 of the -ize verbs, so most common ones (maximize, patronize, authorize, characterize, ...) were missed too. Add 608 pairs: 100 regular -ize/-ise verbs with their conjugations, the missing conjugations for "sanitize"/"deodorize", agent nouns (synthesizer, sterilizer, ...) and -ization/-isation nouns, including those whose verb was already listed. Only pairs where both spellings are genuine variants of the same word, so BR->US stays safe as well - -ise-in-both words (advertise, improvise, capsize, prize, surprise, ...) are left out, and -yze/-yse verbs are skipped because "catalyses"/"analyses" collide with noun plurals. Also fix two entries found while validating: - us="dustbin" br="garbage can" was reversed, so it Americanized in the Britishizer and vice versa. - "jewelery" preceded "jewelry", and for BR->US the first rule matching "jewellery" wins, so it produced the misspelling. 50% more rules would have made the conversion pass slower still, so gate the rules on a token index: a pattern starts with "\b", so its first word can only match a whole word of the input, and a line without that word can never match. Each line now runs the handful of rules whose words it contains instead of all 5541. Output is byte-identical to the old scan over a 49,560-line corpus in both directions; converting 2000 lines drops from 770 ms to 1.5 ms and construction from 96 ms to 12 ms. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Aug 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the miss reported in SubtitleEdit/subtitleedit#13583 ("fantasize" => "fantasise") — and the rest of the same gap.
Word list
The shared list only covered 66
-izeverbs, somaximize,patronize,authorize,characterize,optimize,socialize,synchronizeand ~95 more were missed as well. This adds 608 pairs:-ize/-iseverbs with all conjugations (-ize/-ized/-izes/-izing)sanitizeanddeodorize(only the-edform was listed)synthesizer,sterilizer,vaporizer,digitizer,atomizer,nebulizer,sanitizer,deodorizer-ization/-isationnouns, including for verbs that were already listed (specialization,utilization,mobilization,hospitalization, …)The list drives both directions, so every pair has to be a genuine both-ways variant. Left out on purpose:
-isein both varieties —advertise,improvise,exercise,surprise,compromise,televise,supervise,capsize,prize, … — adding those would make British to American emitadvertize-yze/-yseverbs (catalyze), becausecatalyses/analysescollide with the noun pluralsglamorize(the-ourstem makes the British form ambiguous), plus rare/one-sided ones likewinterize,notarize,exorcize,systemizeTwo bugs found while validating
us="dustbin" br="garbage can"was reversed — American to British turneddustbinintogarbage can, and British to American did the opposite. Nowus="garbage can" br="dustbin"(+ plural).jeweleryprecededjewelry, and for BR→US the first rule matchingjewellerywins, sojewellerybecame the misspellingjewelery. Reordered, with a comment on why the order matters.Keeping it fast
BuildProposals()runs on the UI thread in the window constructor, and 50% more rules would have made that worse. Each rule pattern starts with\b, so its first word can only ever match a whole word of the input — a line that does not contain that word can never match the pattern. Rules are now indexed by that first word, and a line runs only the handful of rules whose words it actually contains instead of all 5541.RegexOptions.Compiledis dropped along with it, since almost no rule runs per line now.Verified byte-identical to the old full scan over a 49,560-line corpus (every word alone / in a sentence / uppercased / titlecased / glued to punctuation, tags and digits, plus 20,000 random multi-word lines) in both directions:
Checks
fantasize/fantasized/fantasizes/fantasizing+FANTASIZE/Fantasizedconvert in both directionsadvertise,improvise,capsize,prize,surprise,exercise,compromisestill untouched<font color="#ff0000">attribute still not BritishizedNeeds a release dispatch for AmericanToBritish and BritishToAmerican (both embed the shared list), then a
se5-plugins.jsonbump.🤖 Generated with Claude Code