Detectors
Street Address
Detect Czech street addresses with component scoring for street, house number, city, and postal code.
Purpose
Use the address detector for Czech street-style addresses.
This detector reports accuracy above 85% and relies on component scoring rather than a single rigid format.
It is useful for full addresses and shorter street-plus-number forms.
Detector Name
addressSupported Formats
Street NumberStreet Number/FlatStreet, City- Full address forms that include postal code and city
Examples:
Dlouhá 15, PrahaVinohradská 1523/45, 120 00 Praha
Validation Logic
The detector tries two address patterns:
- Full address pattern with street, number, postal code, and city
- Simpler street-plus-number pattern
Component Scoring System
FastPII assigns a score from 0 to 100:
- Street component present and plausible:
+30 - House number present and valid:
+30 - Postal code present in Czech form:
+20 - Known Czech city present:
+20
The minimum accepted address score is 60.
Additional Validation Rules
- Street names shorter than 3 characters are rejected.
- Common non-address context words are filtered out.
- Full-address matches require a valid Czech city signal.
- House numbers must fit the detector's numeric pattern.
There is no checksum algorithm for this detector.
Python Examples
Detect an address
from fastpii import PrivacyGuard
guard = PrivacyGuard(regions=["cz"])
result = guard.detect("Bydlí na Dlouhé 15, Praha", detector_names=["address"])
for finding in result.findings:
print(finding.value, finding.metadata)Validate an address-like string
from fastpii import PrivacyGuard
guard = PrivacyGuard(regions=["cz"])
result = guard.validate("Dlouhá 15, Praha", "address")
print(result.is_valid)
print(result.metadata)Expected Metadata
This detector documents these metadata fields:
streethouse_numbercitypostal_codescore
Example Output
{
"street": "Dlouhé",
"house_number": "15",
"city": "Praha",
"postal_code": "",
"score": 80,
}Limitations
- City recognition depends on the built-in Czech city list.
- Short street-plus-number matches can pass with less context than full addresses.
- The score is heuristic, not a postal authority validation.
Notes
Verified detection example from the codebase:
guard.detect("Bydlí na Dlouhé 15, Praha")