Skip to content

feat(analyzer): add IN_DRIVING_LICENCE recognizer - #2564

Open
todkarsant wants to merge 1 commit into
data-privacy-stack:mainfrom
todkarsant:feat/in-driving-licence
Open

todkarsant wants to merge 1 commit into
data-privacy-stack:mainfrom
todkarsant:feat/in-driving-licence

Conversation

@todkarsant

Copy link
Copy Markdown

Summary

  • Add InDrivingLicenceRecognizer for Indian driving licence numbers
  • Format: SS-RR-YYYYNNNNNNN (state code, RTO code, year, serial)
  • Supports hyphens, spaces, and no-separator formats
  • Validates state/UT codes against known set (states + UTs + legacy codes)
  • Validates year of issue against range 1950–current year
  • No published checksum algorithm — validate_result returns None (plausible), never True
  • Ships enabled: false by default
  • Base score 0.3 (medium — distinctive format but no checksum)

Changes

  • New recognizer: predefined_recognizers/country_specific/india/in_driving_licence_recognizer.py
  • Exports added in india/__init__.py and predefined_recognizers/__init__.py
  • YAML config entry in default_recognizers.yaml with enabled: false
  • Docs row in supported_entities.md
  • Tests: exact score assertions, entity boundaries, embedded text, lookalike negatives, context enhancement, and configuration-path test through RecognizerRegistryProvider

Test plan

  • Valid formats detected: no separator, hyphen, space
  • Invalid state codes rejected (returns False)
  • Invalid years rejected (before 1950, after current year)
  • Entity boundaries asserted on embedded text
  • Context words ("driving licence") boost score
  • Lookalike negatives not flagged
  • Configuration-path test loads from YAML and detects

Closes #2465

…licences

Add a new pattern-based recognizer for Indian driving licence numbers
(format: SS-RR-YYYYNNNNNNN). Validates state/UT codes against the known
set and issue year against the range 1950–current year. Ships disabled
by default (enabled: false). No checksum exists for this document type,
so validate_result returns None (plausible) rather than True.

Closes data-privacy-stack#2465

Signed-off-by: Santosh Todkar <[email protected]>
@todkarsant

Copy link
Copy Markdown
Author

@omri374 Could you review this? Adds the Indian driving licence recognizer requested in #2465, following the existing IN_PAN/IN_VEHICLE_REGISTRATION pattern.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add IN_DRIVING_LICENCE recognizer for Indian driving licence numbers

1 participant