Skip to content

Fix dotted abbreviation sentence boundaries - #38

Merged
vanderlee merged 1 commit into
masterfrom
agent/fix-dotted-abbreviation-boundaries
Aug 18, 2026
Merged

vanderlee merged 1 commit into
masterfrom
agent/fix-dotted-abbreviation-boundaries

Conversation

@vanderlee

Copy link
Copy Markdown
Owner

What changed

  • Treat the doubled final period in dotted-initial abbreviations such as a.m.. and A.M.. as a sentence boundary.
  • Prevent fragments ending in multiple periods from being reclassified as abbreviations.
  • Preserve the existing handling of ordinary ellipses and short abbreviations.

Why

The current parser recognizes a. as an abbreviation, but punctuation merging leaves m.. How about Greg? in one fragment. Abbreviation merging then joins both sentences. For uppercase initials, M.. is also incorrectly classified as an abbreviation because it starts with a capital letter.

This makes the existing testSplitLowercaseInitialAbbreviations regression fail in every PHP matrix job.

Impact

Dotted abbreviations can now end a sentence without swallowing the following sentence. Existing abbreviation and ellipsis behavior remains covered by the test suite.

Validation

  • PHPUnit 9.6.36 on PHP 8.5.9: 36 tests, 122 assertions
  • PHP syntax check for src/Sentence.php
  • Focused checks for lowercase and uppercase a.m.. boundaries, e.g.., ordinary ellipses, and existing double-period behavior

@vanderlee
vanderlee marked this pull request as ready for review August 18, 2026 15:16
@vanderlee
vanderlee merged commit 6aa5e7c into master Aug 18, 2026
7 checks passed
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.

1 participant