Skip to content

Commit 0f1ebf3

Browse files
CyberSecDefclaude
andcommitted
Filter n't contraction stems from named-character scanner
The name-candidate regex breaks at apostrophes, so "Don't" yielded "Don" and got handed to the character_reconciliation prompt as a candidate new character. Add the n't contraction stems to _NAMED_CHARACTER_STOP_WORDS so they're filtered when no roster match exists; characters legitimately named one of these are still detected via the roster check that runs first. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent a51dd14 commit 0f1ebf3

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

novelforge/agents/chapter/_helpers.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,11 @@ def scan_vocabulary_overuse(chapter_text: str, genre: str = "") -> list[str]:
433433
"can", "could", "may", "might", "must", "will", "would", "should",
434434
"shall", "be", "is", "was", "were", "are", "am", "been", "being",
435435
"have", "has", "had", "do", "does", "did", "doing", "done",
436+
# Contraction stems — the name regex strips at the apostrophe, so
437+
# "Don't" → "Don", "Wouldn't" → "Wouldn", etc. Roster matches run
438+
# first, so a character actually named one of these is still detected.
439+
"don", "won", "wouldn", "couldn", "shouldn", "wasn", "weren",
440+
"isn", "aren", "hadn", "hasn", "haven", "doesn", "mustn", "ain",
436441
# Common sentence-starting verbs (telling/dialogue tags, imperatives)
437442
"let", "look", "looked", "looking", "see", "seen", "seeing",
438443
"go", "going", "went", "gone", "come", "came", "coming",

0 commit comments

Comments
 (0)