Skip to content

fix: add word boundaries to complex street corrections - #95

Merged
john-c-houser merged 1 commit into
devfrom
fix/street-abbreviation-word-boundaries
Jul 30, 2026
Merged

fix: add word boundaries to complex street corrections#95
john-c-houser merged 1 commit into
devfrom
fix/street-abbreviation-word-boundaries

Conversation

@john-c-houser

Copy link
Copy Markdown
Collaborator

Fixes an issue where street suffix corrections were aggressively replacing letters inside words (e.g., matching 'St' inside 'Crest' or 'Ln' inside 'Lincoln'). Added word boundaries (\b) to the complex street correction regexes in AddressFormat.pm.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the street-address normalization logic to prevent complex street suffix corrections from matching inside longer words (e.g., avoiding replacements like St inside Crest).

Changes:

  • Added word-boundary guards (\b) to the “Complex Street Corrections” regex substitutions in format_street.
  • Ensures multi-token corrections like Ct Ave/Ln St only apply when the abbreviation occurs as a standalone word sequence.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@john-c-houser
john-c-houser merged commit d86e0cf into dev Jul 30, 2026
1 check passed
@john-c-houser
john-c-houser deleted the fix/street-abbreviation-word-boundaries branch July 30, 2026 15:12
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.

2 participants