mirror of
https://github.com/data-privacy-stack/presidio.git
synced 2026-07-23 11:20:55 -05:00
Correct de_fuehrerschein docstring to match the actual pattern scope (#2138)
The class docstring gives "B0" (Berlin) as an example of a
Behördenkürzel and lists `B012345678A` in the Examples line, but the
regex `[A-Z]{2}\d{8}[A-Z0-9]` requires both leading characters to be
letters, so `B012345678A` never matches. The test file's docstring is
the authoritative one — it explicitly notes that single-letter Kfz
codes are used in 2-letter authority forms (e.g. `BO`, `KN`) and that
`B0`-style single-letter-plus-digit combinations are out of scope, and
`test_when_all_de_fuehrerschein_numbers_then_succeed` asserts
`B12345678A` is rejected.
Update the class docstring to match the tests: replace the `"B0"
Berlin` example with `"BO" Bochum`, add a short clarification about
single-letter Kfz codes, and change the misleading `B012345678A`
Examples entry to `BO12345678A`.
Co-authored-by: Sharon Hart <sharonh.dev@gmail.com>
This commit is contained in:
committed by
GitHub
parent
adc7c52618
commit
0aa9f8e442
@@ -13,9 +13,13 @@ class DeFuehrerscheinRecognizer(PatternRecognizer):
|
||||
via FeV reform), the number follows a fixed 11-character structure:
|
||||
|
||||
Pos 1–2: Behördenkürzel – 2 uppercase letters identifying the issuing
|
||||
Fahrerlaubnisbehörde (derived from the Kfz-Zulassungskürzel of
|
||||
the issuing Kreis/Stadt, e.g. "B0" Berlin, "MU" München,
|
||||
"HH" Hamburg, "KO" Koblenz)
|
||||
Fahrerlaubnisbehörde (derived from the Kfz-Zulassungskürzel
|
||||
of the issuing Kreis/Stadt, e.g. "MU" München, "HH" Hamburg,
|
||||
"KO" Koblenz, "BO" Bochum). Single-letter Kfz codes such
|
||||
as "B" (Berlin) or "K" (Köln) are used in combination as
|
||||
2-letter authority codes here (e.g. "BO", "KN"); pure
|
||||
single-letter + digit forms like "B0" are out of scope for
|
||||
this strict pattern (see tests/test_de_fuehrerschein_recognizer.py).
|
||||
Pos 3–5: Behördennummer – 3-digit authority code within the Bundesland
|
||||
(assigned by the Kraftfahrt-Bundesamt, KBA)
|
||||
Pos 6–10: Laufende Nummer – 5-digit sequential issue number
|
||||
@@ -27,7 +31,7 @@ class DeFuehrerscheinRecognizer(PatternRecognizer):
|
||||
EU standard: Annex I to Directive 2006/126/EC (Field 5).
|
||||
Data protection: DSGVO Art. 4 Nr. 1 (personenbezogene Daten), BDSG.
|
||||
|
||||
Examples (fictitious): B012345678A, MU12345678B, HH98765432C
|
||||
Examples (fictitious): BO12345678A, MU12345678B, HH98765432C
|
||||
|
||||
Scope note: Pre-2013 German driving licenses (pink folded card, laminated
|
||||
card) used locally defined, non-standardized number formats and remain
|
||||
|
||||
Reference in New Issue
Block a user