feat(analyzer): Add CaBnRecognizer for Canadian Business Numbers (CA_BN) - #2207
Open
Joey239716 wants to merge 5 commits into
Open
feat(analyzer): Add CaBnRecognizer for Canadian Business Numbers (CA_BN)#2207Joey239716 wants to merge 5 commits into
Joey239716 wants to merge 5 commits into
Conversation
Adds CaBnRecognizer detecting the 9-digit CRA Business Number and its 15-character program account form (e.g. 123456782 RT 0001), validated with the Luhn checksum. Registered disabled by default with en/fr support, following the CA_SIN and CA_POSTAL_CODE precedents.
Replace \b word boundaries with lookaround anchors so 9-digit runs joined to larger tokens by '.', '/' or '-' (serial numbers, decimals) are not matched, with regression tests for those cases. Update the CRA reference link and document the SIN ambiguity in the docstring.
Author
|
Hi @SharonHart, gentle nudge on this PR when you get a chance, Thanks! |
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
CaBnRecognizerfor the Canadian Business Number (entity typeCA_BN), a 9-digit business identifier issued by the Canada Revenue Agency.123456782 RT 0001(medium pattern, 0.5), covering the common CRA program identifiers RT, RP, RC, RM, RR, RZinvalidate_result(same scheme asCA_SIN), plus an all-same-digit guard since000000000passes Luhndefault_recognizers.yamlwithenabled: falseanden/frsupport, following the CA_SIN and CA_POSTAL_CODE (feat: Add CaPostalCodeRecognizer for Canadian postal codes (CA_POSTAL… #2204) precedentsdocs/supported_entities.mdIssue reference
Fixes #2206
Checklist