feat: comma substitution, paired dash detection, conjunction handling #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/comma-substitution-paired-dash"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Three changes to the em dash substitution engine:
1. Comma substitution path
New
_WEAK_STARTERSset:that,which,who,whom,whose,where,when→,instead of:or;.New
_COORDINATING_STARTERSset:but,yet,so,nor→,instead of;(semicolon before a conjunction was redundant).2. Paired em dash detection
Detects
— text —patterns and substitutes appropriately:which/who/that/etc.) →, commas,(parentheses)3. Bug fix: between-text extraction
Fixed a bug where
_is_paired_dashuseddash_positions[start] + 1which landed inside the em dash regex match. Now usesre.Match.end()and.start()for accurate position tracking.What this fixes
The original MFT response that motivated this change:
"psychological systems — "foundations" — that are present"→"psychological systems (\"foundations\") that are present"(was: ;)"moral disagreements — especially between liberals and conservatives — are"→"moral disagreements (especially between liberals and conservatives) are"(was: ;)"it was hard — but we did it"→"it was hard, but we did it"(was; but)Tests
test_new_features.pywith 22 tests covering all new behaviors