Skip to content

feat: add Turkish license plate (TR_LICENSE_PLATE) recognizer#1999

Merged
SharonHart merged 5 commits into
microsoft:mainfrom
mrcuren:feat/turkey-license-plate-recognizer
Apr 27, 2026
Merged

feat: add Turkish license plate (TR_LICENSE_PLATE) recognizer#1999
SharonHart merged 5 commits into
microsoft:mainfrom
mrcuren:feat/turkey-license-plate-recognizer

Conversation

@mrcuren
Copy link
Copy Markdown
Contributor

@mrcuren mrcuren commented Apr 23, 2026

Adds Turkish vehicle license plate recognizer to Presidio Analyzer.

The Turkish license plate (plaka) follows the format: [province_code 01-81] [1-3 letters] [2-4 digits].
It is considered PII under Turkish KVKK (Personal Data Protection Law) when linked to an identifiable vehicle owner.

Features:

  • Pattern recognition for standard civilian plates (province codes 01-81)
  • Letters exclude Q, W, X (not in Turkish alphabet)
  • Province code validation via validate_result()
  • Context words for higher confidence detection (plaka, araç plakası, license plate, etc.)
  • Handles space, no-space, and hyphen separators
  • Disabled by default as per country-specific recognizer guidelines

Legal basis: Karayolları Trafik Kanunu (KTK) Madde 23.

Issue reference

Part of #1973

Testing

  • Added test_tr_license_plate_recognizer.py with comprehensive test coverage
  • Tests include valid plates, invalid province codes, multiple plates, and false positive checks
  • All existing tests continue to pass

Checklist

  • I have reviewed the contribution guidelines
  • My code follows the project style guidelines (ruff, pytest)
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have updated the CHANGELOG.md under the Unreleased section
  • I have updated the supported_entities.md documentation
  • I have added my recognizer to default_recognizers.yaml with enabled: false
  • I have added my recognizer to __init__.py and __all__

@mrcuren mrcuren force-pushed the feat/turkey-license-plate-recognizer branch from f4c7915 to 186ca27 Compare April 23, 2026 22:07
@mrcuren
Copy link
Copy Markdown
Contributor Author

mrcuren commented Apr 25, 2026

@SharonHart This PR is ready for review. It follows the same pattern as merged PR #1995 and is part of #1973.

SharonHart
SharonHart previously approved these changes Apr 26, 2026
SharonHart and others added 3 commits April 26, 2026 14:32
- Add Turkey (TR) support to generic PhoneRecognizer
- Extend TR_PHONE_NUMBER to support geographic numbers (2/3/4 prefix)
- Implement ITU-T E.164 compliant validation with MNP awareness
- Add Turkish context words for better detection accuracy
- Update tests and documentation for enhanced coverage
- Legal basis: KTK Madde 23, ITU-T E.164 compliance

Addresses SharonHart's feedback on country-specific checks
…clean

Separate TR_PHONE_NUMBER recognizer into its own branch/PR.
PR microsoft#1999 should only contain TR_LICENSE_PLATE changes.
@mrcuren
Copy link
Copy Markdown
Contributor Author

mrcuren commented Apr 26, 2026

@SharonHart This PR has been cleaned up - it now contains only the TR_LICENSE_PLATE recognizer. The TR_PHONE_NUMBER changes have been moved to a separate PR (#2006) as discussed in #1973. Ready for re-review when you have a chance.

@SharonHart SharonHart merged commit 6a009e3 into microsoft:main Apr 27, 2026
34 checks passed
mrcuren added a commit to mrcuren/presidio that referenced this pull request Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants