feat(analyzer): add Canadian postal code (CA_POSTAL_CODE) recognizer#2164
Open
Joey239716 wants to merge 1 commit into
Open
feat(analyzer): add Canadian postal code (CA_POSTAL_CODE) recognizer#2164Joey239716 wants to merge 1 commit into
Joey239716 wants to merge 1 commit into
Conversation
Add CaPostalCodeRecognizer for Canadian postal codes in the A1A 1A1 format, following the UK_POSTCODE recognizer conventions. Uses two patterns: a higher-confidence match for the canonical space-separated form and a lower-confidence match for the space-omitted form. Encodes Canada Post letter rules (excludes D, F, I, O, Q, U everywhere and W, Z as the first letter) and includes English and French context words. Disabled by default, consistent with other country-specific recognizers. Registered in the predefined recognizers package and default recognizers config, with tests and documentation. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Description
Adds
CaPostalCodeRecognizerfor Canadian postal codes (entityCA_POSTAL_CODE)in the
A1A 1A1(letter, digit, letter, optional space, digit, letter, digit) formatspace-separated form, and a lower-confidence match (0.1) for the space-omitted
form commonly seen in stored data.
W, Z as the first letter.
__init__.py) anddefault_recognizers.yaml(withcountry_code: ca), plus unit tests anddocumentation (
supported_entities.md,CHANGELOG.md).Issue reference
Fixes #2163
Checklist