Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions internal/config/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ func (c *Config) validate() error {
knownPacks := map[string]bool{
"company-forms": true,
"de-cities": true,
"de-firstnames": true,
}
for _, packName := range gaz.Packs {
if !knownPacks[packName] {
Expand Down
1 change: 1 addition & 0 deletions internal/pii/gazetteer.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ func isWordBoundary(runes []rune, startRune, endRune int) bool {
var embeddedPackRegistry = map[string]string{
"company-forms": "gazetteer_packs/company-forms.txt",
"de-cities": "gazetteer_packs/de-cities.txt",
"de-firstnames": "gazetteer_packs/de-firstnames.txt",
}

// loadEmbeddedPack loads a Gazetteer from an embedded pack file by name.
Expand Down
93 changes: 85 additions & 8 deletions internal/pii/gazetteer_packs/de-cities.txt
Original file line number Diff line number Diff line change
@@ -1,25 +1,54 @@
# locale: de
# type: CITY
#
# Curated set of unambiguous German city names for use as a template pack.
# Only cities whose names are not common German words are included here to
# minimise false positives. Avoid common-word cities such as "Essen", "Hof",
# "Landsberg", "Neustadt", "Bad" (prefix), or "Berg" (suffix component).
# Curated list of major German cities compiled from public knowledge and
# general reference sources. This file is an original curated work — it is
# NOT a copy of any licensed dataset (no GeoNames, OSM, or proprietary
# database). Conservative curation: cities whose names are also common
# everyday German words where the non-city meaning dominates are excluded to
# minimise false positives. When in doubt, the city is left out.
# Precision over recall.
#
# This pack is intentionally small. Operators should supplement it with their
# own domain-specific gazetteer files via pii.gazetteer.dirs.
# This pack is OPT-IN: it is only loaded when "de-cities" is listed in
# settings.pii.gazetteer.packs.
#
# Excluded (common word meaning dominates or high FP risk):
# Essen (essen = to eat)
# Hof (Hof = courtyard/farm)
# Berg (Berg = mountain)
# Bad (Bad = bath/spa — prefix in many city names, but standalone "Bad" is a word)
# Neustadt (Neue Stadt = new city, very generic)
# Landsberg (Landsberg = generic compound, ambiguous)
# Hameln (marginal, very small)
# Siegen (siegen = to win/prevail — verb meaning dominates in prose)
# Singen (singen = to sing — verb meaning dominates in prose)
#
# German spelling with umlauts is used (the gazetteer folds case per-rune).
# ASCII variants (Muenchen, Nuernberg, Koeln, Duesseldorf) are intentionally
# omitted — they are rarely used in German-language text and add FP surface.
#
# ── Top tier (largest cities, unambiguous names) ─────────────────────────────
Berlin
Hamburg
München
Köln
Frankfurt am Main
Stuttgart
Düsseldorf
Dortmund
Stuttgart
Leipzig
Dresden
Hannover
Nürnberg
Bremen
Duisburg
Bochum
Wuppertal
Bielefeld
Bonn
Mannheim
Karlsruhe
# ── Large cities ─────────────────────────────────────────────────────────────
Wiesbaden
Münster
Augsburg
Expand Down Expand Up @@ -67,7 +96,6 @@ Jena
Remscheid
Erlangen
Moers
Siegen
Salzgitter
Gütersloh
Hildesheim
Expand All @@ -80,3 +108,52 @@ Witten
Zwickau
Dessau
Wilhelmshaven
# ── Mid-tier cities (unambiguous names) ─────────────────────────────────────
Wolfenbüttel
Ratingen
Lünen
Velbert
Minden
Villingen-Schwenningen
Hanau
Koblenz
Tübingen
Flensburg
Gießen
Reutlingen
Esslingen am Neckar
Offenburg
Bayreuth
Bamberg
Aschaffenburg
Straubing
Passau
Landshut
Rosenheim
Kempten
Konstanz
Friedrichshafen
Ravensburg
Sindelfingen
Böblingen
Ludwigsburg
Schwäbisch Gmünd
Aalen
Heidenheim
Weimar
Plauen
Wismar
Greifswald
Stralsund
Frankfurt an der Oder
Brandenburg an der Havel
Dessau-Roßlau
Halle an der Saale
Halberstadt
Stendal
Paderborn
Detmold
Soest
Arnsberg
Herne
Unna
Loading
Loading