Skip to content

Keep street address matches on one line - #116

Merged
jzonthemtn merged 2 commits into
philterd:mainfrom
vamsibvv:street-address-single-line
Nov 12, 2026
Merged

jzonthemtn merged 2 commits into
philterd:mainfrom
vamsibvv:street-address-single-line

Conversation

@vamsibvv

@vamsibvv vamsibvv commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #115.

The street address pattern joined its parts with \s, so a match could span lines: in the issue's example, 50613\n\nDear Dr was detected as an address. The parts are now joined by [ \t]+, the same change as the Java fix in philterd/phileas#477, so a match stays on one line.

Tests cover the reproduction (one match, 214 Juniper Court), the ZIP and greeting lines joined by \n and by \r\n, a number and a street type on different lines, and multi-line address blocks where the street line is still found, including one with a unit. The reproduction test and the three new negative cases fail on main. The full suite passes (2399 passed, the model download e2e test not run).

One difference from before: Python's \s also matched a no-break space and other Unicode spaces, so 123 and Main Street joined by a no-break space (U+00A0) was detected and now is not, as in Java. If you'd rather keep those, [^\S\r\n] would do it; I kept [ \t] because the issue asks for Java's behavior.

AI assistance (Claude Code) was used for this change.

@vamsibvv
vamsibvv force-pushed the street-address-single-line branch from 3039114 to 1c9d2c3 Compare November 11, 2026 06:55

@jzonthemtn jzonthemtn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @vamsibvv , looks great! Happy to merge when the commit is signed. (Sorry about that.)

Signed-off-by: Vamsi <16957347+vamsibvv@users.noreply.github.com>
@vamsibvv
vamsibvv force-pushed the street-address-single-line branch from c5868d7 to 7ca2cdf Compare November 11, 2026 17:31
@vamsibvv

Copy link
Copy Markdown
Contributor Author

Signed off now, thanks!

Signed-off-by: Jeff Zemerick <13176962+jzonthemtn@users.noreply.github.com>
@jzonthemtn
jzonthemtn merged commit ebb7744 into philterd:main Nov 12, 2026
3 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.

Street address filter matches across line breaks and reads "Dr." in a greeting as a street suffix

2 participants