Repository navigation
Conversation
WORD_RUNS split at apostrophes, so "can't" counted as two words and a line with contractions got a longer hold floor than its real word count. Refs heygen-com#6338
jrusso1020
approved these changes
Oct 25, 2026
jrusso1020
left a comment
Collaborator
There was a problem hiding this comment.
Approved. Contractions with straight or curly apostrophes now count as one word, surrounding quotes stay out, and the old regex fails the new test. CJK and hold-time rules are unchanged. Thanks!
This branch has not been deployed
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.
What
readingWords()keeps an apostrophe between letters inside a word run, socan't,can’t,don'tandit'scount as one word each.Why
WORD_RUNSstopped at'and’, so every contraction counted as two words andline_unreadset a longer hold floor than the line's real word count. "a tooth can't get in" counted 6 words instead of 5.Related work
Refs #6338. This covers the contractions. Hyphenated words still count per part:
Intl.Segmentersplitsrock-and-rollat the hyphens even inside one run, and for a hold time three parts read about as long as three words, so I left that as is. The docs pointer about the captions track from the same issue isn't in here either.How
The run regex now takes
['’]followed by more letters or numbers:/[\p{L}\p{M}\p{N}%$]+(?:['’][\p{L}\p{M}\p{N}]+)*/gu. A quote that doesn't sit between letters ('quoted', a lone') still isn't part of a run. The segmenter keepscan'tas one word-like segment, so the CJK path is unchanged.Test plan
craftAudit.test.ts(straight and typographic apostrophe, plus a quoted word). It fails on main (expected 6 to be 5) and passes here; the file's 21 tests pass.oxlintandoxfmt --checkare clean on both files.