-
Notifications
You must be signed in to change notification settings - Fork 901
Add Japanese and Chinese mobile number test cases for PhoneRecognizer #1808
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This commit adds international PHONE_NUMBER test cases for Presidio Analyzer: - Japanese mobile number formats: 090/080/070 - Chinese mobile number formats: 11-digit numbers starting with 1 These tests improve international coverage for the PhoneRecognizer.
|
Hi @WenwenHLF, Presidio has a few default regions for the phone recognizers. Japan and China are not part of the default, so it's likely not going to work. If you'd like, add Japan and China to the supported regions in the test. recognizer = PhoneRecognizer(leniency=leniency)presidio/presidio-analyzer/presidio_analyzer/predefined_recognizers/generic/phone_recognizer.py Line 28 in e606fee
See this comment for more info on defining regions: |
…s override
This update adds Japanese and Chinese phone number examples to the phone recognizer test suite. The recognizer fixture is extended with supported_regions = DEFAULT_SUPPORTED_REGIONS + ("JP", "CN") so that the new cases can be detected without changing the library’s default behavior.
Only the test fixture is modified; leniency and other tests remain unchanged.
|
Hi @omri374 , Thanks for the suggestion! I've updated the test fixture so that PhoneRecognizer is initialized with JP and CN added to supported_regions. This allows the new test cases to pass without modifying the default regions. |
|
Hi maintainers, Thank you! |
Change Description
This commit adds international PHONE_NUMBER test cases for Presidio Analyzer:
These tests improve international coverage for the PhoneRecognizer.
Checklist