Skip to content

Recognize single-word period sentences - #36

Draft
vanderlee wants to merge 7 commits into
agent/modernize-test-matrixfrom
agent/single-word-period-sentences
Draft

vanderlee wants to merge 7 commits into
agent/modernize-test-matrixfrom
agent/single-word-period-sentences

Conversation

@vanderlee

@vanderlee vanderlee commented Aug 3, 2026 •

Copy link
Copy Markdown
Owner

What changed

  • Replace the broad “short capitalized token” abbreviation heuristic with explicit handling for common abbreviations, initials, dotted acronyms, Roman numerals, and numeric/list markers.
  • Recognize ordinary one-word sentences ending in a single period without treating ellipses as boundaries.
  • Remove empty fragments produced when trimmed line-separated list items are returned.
  • Add regressions for Go. Stop. Wait., the example from issue "Sentences must be at least two words long, unless a linebreak or end-of-text." #4, ordered lists, ellipses, numeric sentence endings, and existing abbreviation behavior.
  • Update the documented boundary rule.

Why

The previous heuristic could not distinguish Go. from an abbreviation because any short capitalized word ending in a period was treated as one. Ordered-list prefixes still need to remain attached to their item text, and legacy abbreviation and ellipsis behavior must remain stable.

Validation

The focused patch workflow passed all 35 tests and 123 assertions on PHP 8.4. The complete stacked GitHub Actions matrix also passed on PHP 5.4, 5.6, 7.4, 8.0, 8.4, and 8.5.

This broader abbreviation classification overlaps the narrower change in PR #33 and should replace that parser portion rather than be merged independently after it.

Closes #4.
Closes #23.

@vanderlee
vanderlee changed the base branch from agent/modernize-test-matrix to master August 3, 2026 07:00
@vanderlee vanderlee closed this Aug 3, 2026
@vanderlee vanderlee reopened this Aug 3, 2026
@vanderlee
vanderlee changed the base branch from master to agent/modernize-test-matrix August 3, 2026 07:06
@vanderlee vanderlee closed this Aug 3, 2026
@vanderlee vanderlee reopened this Aug 3, 2026
@vanderlee vanderlee closed this Aug 3, 2026
@vanderlee vanderlee reopened this Aug 3, 2026
@vanderlee

Copy link
Copy Markdown
Owner Author

Currently explicitely support english hardcoded abreviations. Do not merge as is.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ordered List "Sentences must be at least two words long, unless a linebreak or end-of-text."

1 participant