package iace

// KeywordEntry maps German/English keywords to component library IDs,
// energy source IDs, and additional tags for deterministic text parsing.
type KeywordEntry struct {
	Keywords     []string // Search terms (lowercase, may include partial matches)
	ComponentIDs []string // Matched component library IDs (C001-C135)
	EnergyIDs    []string // Matched energy source IDs (EN01-EN20)
	ExtraTags    []string // Additional tags derived from keyword context
	// MachineTypes restricts this keyword to specific machine types.
	// Empty = matches all machine types. If set, only matches when the
	// project's machine_type is in this list.
	MachineTypes []string // e.g. ["press", "hydraulic_press"]
}

// GetKeywordDictionary returns the complete keyword dictionary for
// deterministic narrative parsing. ~250 entries covering industrial
// machinery terminology in German and English.
func GetKeywordDictionary() []KeywordEntry {
	return []KeywordEntry{
		// ── Pressen / Umformmaschinen (NUR fuer press/hydraulic_press) ──
		{Keywords: []string{"presse", "press", "umform", "umformung"}, ComponentIDs: []string{"C008", "C122"}, EnergyIDs: []string{"EN01"}, ExtraTags: []string{"high_force", "crush_point"}, MachineTypes: []string{"press", "hydraulic_press", "mechanical_press", "stamping_press"}},
		{Keywords: []string{"kniehebel", "toggle"}, ComponentIDs: []string{"C121"}, ExtraTags: []string{"mechanical_transmission"}, MachineTypes: []string{"press"}},
		{Keywords: []string{"stossel", "stoessel", "ram", "slide"}, ComponentIDs: []string{"C122"}, EnergyIDs: []string{"EN01"}, ExtraTags: []string{"moving_part", "crush_point", "gravity_risk"}, MachineTypes: []string{"press", "hydraulic_press", "mechanical_press"}},
		{Keywords: []string{"stempel", "punch", "matrize", "die"}, ComponentIDs: []string{"C126"}, ExtraTags: []string{"crush_point", "cutting_part"}, MachineTypes: []string{"press", "hydraulic_press", "mechanical_press", "stamping_press"}},
		{Keywords: []string{"schwungrad", "flywheel"}, ComponentIDs: []string{"C133"}, EnergyIDs: []string{"EN02", "EN03"}, ExtraTags: []string{"stored_energy", "rotating_part"}, MachineTypes: []string{"press", "mechanical_press"}},
		{Keywords: []string{"werkzeugeinbauraum", "die space"}, ComponentIDs: []string{"C132"}, ExtraTags: []string{"crush_point", "pinch_point"}, MachineTypes: []string{"press", "hydraulic_press", "mechanical_press"}},

		// ── Foerdertechnik ──────────────────────────────────────────────
		{Keywords: []string{"foerderband", "transportband", "conveyor"}, ComponentIDs: []string{"C003"}, EnergyIDs: []string{"EN01", "EN02"}, ExtraTags: []string{"entanglement_risk"}},
		{Keywords: []string{"transfer", "transferanlage", "transfersystem"}, ComponentIDs: []string{"C127"}, ExtraTags: []string{"shear_risk", "pinch_point"}},
		// Hubgeraete: korrigiert auf EN03 (Potentielle/Gravitational) statt
		// nur EN04 (Elektrisch). Audit-Methode A zeigte, dass HP1014/HP1015/
		// HP1017/HP1018 (alle Quetsch-Patterns unter absenkender Last) nicht
		// zuendeten weil sowohl crush_point als auch gravitational fehlten.
		// EN04 bleibt fuer Steuerstrom-bezogene Patterns mit drin.
		{Keywords: []string{"aufzug", "elevator", "lift"}, ComponentIDs: []string{"C014", "C128"}, EnergyIDs: []string{"EN03", "EN04"}, ExtraTags: []string{"gravity_risk", "person_under_load", "crush_point"}},
		{Keywords: []string{"hubwerk", "hoist", "hubgeraet"}, ComponentIDs: []string{"C128"}, EnergyIDs: []string{"EN03", "EN04"}, ExtraTags: []string{"gravity_risk", "person_under_load", "crush_point"}},
		// Hub-Verben aus Methode-C-Vocabulary-Diff: "absenken/senken/
		// anheben/heben/hubhoehe" tauchten im Limits-Form auf, der Parser
		// kannte sie nicht. Konservativ EN03 + Tags, Component bleibt offen.
		{Keywords: []string{"absenk", "senken", "anheben", "heben"}, EnergyIDs: []string{"EN03"}, ExtraTags: []string{"gravity_risk", "person_under_load", "crush_point"}},
		{Keywords: []string{"hubhoehe", "hubweg", "hubgeschwindig"}, EnergyIDs: []string{"EN03"}, ExtraTags: []string{"gravity_risk", "crush_point"}},
		// Generische Hub-/Mobil-Vocabulary (domaenenuebergreifend, nicht
		// maschinenspezifisch): Hubtische, Hebebuehnen, Scherenhubgeraete und
		// fahrbare Standgeraete. Mappt auf bestehende Komponenten C014 (Hubwerk)
		// + C030 (Plattform/Buehne). Cross-validiert gegen Bremse-GT (neutral)
		// und Kistenhub-GT (hebt Komponenten-Extraktion).
		{Keywords: []string{"hubtisch", "hubplattform", "scherenhub", "scherenhubtisch", "hebebuehne", "hebevorrichtung", "lifting platform", "scissor lift"}, ComponentIDs: []string{"C014", "C030"}, EnergyIDs: []string{"EN03", "EN04"}, ExtraTags: []string{"gravity_risk", "person_under_load", "crush_point"}},
		{Keywords: []string{"plattform", "buehne", "platform"}, ComponentIDs: []string{"C030"}, EnergyIDs: []string{"EN03"}, ExtraTags: []string{"gravity_risk"}},
		{Keywords: []string{"palette", "palettenhub", "gabelhub"}, ComponentIDs: []string{"C014"}, ExtraTags: []string{"gravity_risk", "crush_point"}},
		{Keywords: []string{"fahrwerk", "lenkrolle", "fahrbar", "verfahrbar"}, ExtraTags: []string{"mobile_machine", "tip_over_risk"}},
		{Keywords: []string{"standsicher", "standsicherheit", "kippen", "kippgefahr", "umkippen"}, ExtraTags: []string{"tip_over_risk", "gravity_risk"}},
		// Domaenen-Capability-Tags (Emit-Seite des Capability-Domain-Gatings,
		// siehe pattern_domain_gates.go). Ein domaenenspezifisches Narrativ
		// erzeugt hier den dom_*-Tag, sodass die gegateten Patterns fuer ihre
		// echte Maschine weiter feuern. Gate (Pattern-Text) + Emit (Narrative)
		// teilen dasselbe Vokabular. INVARIANT: jeder dom_*-Tag aus
		// pattern_domain_gates.go MUSS hier emittierbar sein (sonst Ghost).
		{Keywords: []string{"presse", "stanzpresse", "exzenterpresse", "umformpresse", "pressenhub", "stanzhub", "stanzen"}, ExtraTags: []string{"dom_press"}},
		{Keywords: []string{"spritzguss", "spritzgie", "extruder", "extrusion", "kunststoffspritz"}, ExtraTags: []string{"dom_plastics"}},
		{Keywords: []string{"walzwerk", "kalander", "zweiwalzenwerk", "walzenspalt", "laminieranlage", "laminier"}, ExtraTags: []string{"dom_rolling"}},
		{Keywords: []string{"spinnmaschine", "webmaschine", "spinnerei", "textilmaschine"}, ExtraTags: []string{"dom_textile"}},
		{Keywords: []string{"schleifscheibe", "schleifmaschine", "schleifbock"}, ExtraTags: []string{"dom_grinding"}},
		{Keywords: []string{"schweissen", "schweissnaht", "lichtbogenschweiss", "widerstandsschweiss", "schutzgasschweiss"}, ExtraTags: []string{"dom_welding"}},
		{Keywords: []string{"photovoltaik", "pv-modul", "pv-anlage", "solarmodul", "solaranlage"}, ExtraTags: []string{"dom_solar"}},
		{Keywords: []string{"windkraft", "windenergieanlage", "rotorblatt", "gondel"}, ExtraTags: []string{"dom_wind"}},
		{Keywords: []string{"drehmaschine", "fraesmaschine", "zerspanung"}, ExtraTags: []string{"dom_cnc"}},
		{Keywords: []string{"maehdrescher", "ballenpresse", "feldhaecksler", "traktor"}, ExtraTags: []string{"dom_agri"}},
		{Keywords: []string{"rolltreppe", "fahrtreppe", "fahrsteig"}, ExtraTags: []string{"dom_escalator"}},
		{Keywords: []string{"glasschneid", "glasbearbeitung", "flachglas", "glasscheibe", "glaskante", "glasmaschine"}, ExtraTags: []string{"dom_glass"}},
		{Keywords: []string{"im freien", "freigelaende", "ausseneinsatz", "aussenarbeit", "witterung", "forstarbeit", "freiland", "aussengelaende", "winterdienst"}, ExtraTags: []string{"dom_outdoor"}},
		{Keywords: []string{"lueftungsanlage", "lueftungskanal", "klimaanlage", "feuchtraum"}, ExtraTags: []string{"dom_ventilation"}},
		{Keywords: []string{"kuehlschmierstoff", "kss-anlage", "kss-kreislauf", "kss-aufbereitung", "bearbeitungszentrum", "kuehlturm"}, ExtraTags: []string{"dom_machining"}},
		{Keywords: []string{"silo", "schuettgut", "gaerbehaelter", "getreidesilo", "mehlsilo", "schuettgutfoerder"}, ExtraTags: []string{"dom_bulk"}},
		{Keywords: []string{"palettierer", "palettieranlage", "palettierroboter"}, ExtraTags: []string{"dom_palletizer"}},
		{Keywords: []string{"spielplatz", "klettergeraet", "spielgeraet", "spielturm", "schaukel", "wippe", "rutsche", "sandkasten"}, ExtraTags: []string{"dom_playground"}},
		{Keywords: []string{"kraftstation", "fitnessgeraet", "trainingsgeraet", "kraftgeraet", "langhantel"}, ExtraTags: []string{"dom_fitness"}},
		{Keywords: []string{"schwimmbad", "schwimmbecken", "schwimmhalle", "planschbecken", "whirlpool", "badebecken"}, ExtraTags: []string{"dom_aquatic"}},
		{Keywords: []string{"karussell", "fahrgeschaeft", "freizeitpark", "vergnuegungspark", "riesenrad", "achterbahn"}, ExtraTags: []string{"dom_amusement"}},
		{Keywords: []string{"fahrersitz", "fahrerkabine", "fahrerstand", "fahrerhaus", "gabelstapler", "radlader", "baumaschine"}, ExtraTags: []string{"dom_mobile_cab"}},
		{Keywords: []string{"lackier", "lackierkabine", "pulverbeschicht", "beschichtungsanlage", "spritzlackier", "tauchlackier"}, ExtraTags: []string{"dom_coating"}},
		{Keywords: []string{"tanklager", "raffinerie", "tankfarm", "chemiepark", "tankfeld"}, ExtraTags: []string{"dom_exproc"}},
		{Keywords: []string{"reaktor", "chemieanlage", "ruehrkessel", "mischreaktor", "reaktionsbehaelter"}, ExtraTags: []string{"dom_chem"}},
		{Keywords: []string{"sauerstoffanlage", "sauerstoff-versorgung", "sauerstoffversorgung", "medizinische gase"}, ExtraTags: []string{"dom_o2"}},
		{Keywords: []string{"roboter", "roboterarm", "roboterzelle", "cobot", "industrieroboter", "knickarm", "manipulatorarm"}, ExtraTags: []string{"dom_robot"}},
		{Keywords: []string{"bandsaege", "saegemaschine", "gattersaege", "saegewerk", "blockbandsaege"}, ExtraTags: []string{"dom_sawing"}},
		{Keywords: []string{"folienwickler", "wickelmaschine", "konfektioniermaschine", "folienverpackung", "wellpappe"}, ExtraTags: []string{"dom_converting"}},
		{Keywords: []string{"bergbau", "untertage", "tunnelbau", "off-grid"}, ExtraTags: []string{"dom_remote"}},
		{Keywords: []string{"asbest", "asbestsanierung", "asbestexposition"}, ExtraTags: []string{"dom_asbestos"}},
		{Keywords: []string{"gasbrenner", "brennerbetrieb", "offene flamme", "flammhaert", "abflammen", "flammrichten"}, ExtraTags: []string{"dom_flame"}},
		{Keywords: []string{"heissleim", "heissleimanlage", "schmelzkleber", "schmelzklebstoff", "klebstoffschmelzer", "leimwerk"}, ExtraTags: []string{"dom_glue"}},

		// ── Gewerbliche Spuelmaschine / Warewashing ──────────────────────
		// dom_warewashing gates the warewashing-specific patterns
		// (hazard_patterns_warewashing.go) so they never leak into other
		// machine classes. The functional tags (hot_water, steam_emission,
		// corrosive_chemical, access_door) are the within-domain triggers.
		{Keywords: []string{"spuelmaschine", "geschirrspuelmaschine", "geschirrspueler", "haubenspuelmaschine", "untertischspuelmaschine", "korbspuelmaschine", "bandspuelmaschine", "glaeserspuelmaschine", "bistrospuelmaschine", "warewashing", "dishwasher"}, ExtraTags: []string{"dom_warewashing"}},
		{Keywords: []string{"heisswasser", "nachspuelung", "nachspueltemperatur", "spuelgang", "spuelzyklus", "thermostopp", "thermostop"}, ExtraTags: []string{"hot_water", "high_temperature"}},
		{Keywords: []string{"dampf", "wrasen", "schwaden", "brueden"}, ExtraTags: []string{"steam_emission", "high_temperature"}},
		{Keywords: []string{"boiler", "spuelboiler", "nachspuelboiler", "tankheiz", "boilerheiz"}, ComponentIDs: []string{"C094"}, ExtraTags: []string{"heating_element", "high_temperature"}},
		{Keywords: []string{"reiniger", "klarspueler", "spuelmittel", "reinigungsmittel", "reinigerkonzentrat", "spuelchemie", "dosiergeraet", "dosierpumpe", "sauglanze", "entkalker"}, ExtraTags: []string{"corrosive_chemical"}},
		// Spuelarm/Spuelfeld emit only the rotating_part capability tag. They are
		// NOT mapped to a library component — C004 is a "Drehtisch" (rotary table)
		// and that mislabels the spray arm. Keyword->component must be semantically
		// honest (generic hygiene; surfaced by the warewashing GT).
		{Keywords: []string{"spuelarm", "spuelfeld", "wascharm", "spruehfeld"}, ExtraTags: []string{"rotating_part"}},
		{Keywords: []string{"spuelkammer", "spueltuer", "geraetetuer", "haubentuer", "klapptuer"}, ExtraTags: []string{"access_door"}},
		// Frischwasseranschluss an das Trinkwassernetz -> Rueckfluss/Ruecksaug-Risiko (EN 1717).
		{Keywords: []string{"rueckfluss", "rueckflussverhinderer", "ruecksaug", "trinkwasser", "frischwasseranschluss", "systemtrenner"}, ExtraTags: []string{"backflow_risk"}},
		{Keywords: []string{"scharfe kante", "scharfkant", "blechkante", "scharfe blechkante", "sieb", "siebe"}, ExtraTags: []string{"sharp_edge"}},
		// Ghost-Closure (Emit-Seite): macht die 34 toten Required-Tags
		// emittierbar, jeweils NUR via domaenenspezifische Keywords -> die 120
		// Ghost-Patterns feuern wieder, aber nur fuer ihre echte Maschine (kein
		// generischer Bridge auf rotating_part/moving_part, der wieder leaken
		// wuerde). Regression-Guard: TestTagVocabulary_GhostPatterns -> 0.
		{Keywords: []string{"fraeser", "bohrer", "drehmeissel", "schneidwerkzeug", "zerspanwerkzeug", "wendeschneidplatte"}, ExtraTags: []string{"cutting_tool", "kinetic_rotational", "kinetic_translational"}},
		{Keywords: []string{"spannfutter", "drehfutter", "werkstueckaufnahme", "werkstueckspanner"}, ExtraTags: []string{"workpiece_holder"}},
		{Keywords: []string{"schleifscheibe", "schleifbock"}, ExtraTags: []string{"grinding_wheel"}},
		{Keywords: []string{"schweissbrenner", "schweisszange", "schweissstromquelle", "schweissen"}, ExtraTags: []string{"welding_equipment"}},
		{Keywords: []string{"agv", "fts", "fahrerloses transportfahrzeug", "fahrerloses transportsystem", "fahrerlos"}, ExtraTags: []string{"agv", "chassis"}},
		{Keywords: []string{"fahrkorb", "aufzugskabine"}, ExtraTags: []string{"elevator_car"}},
		{Keywords: []string{"aufzugsschacht", "fahrschacht"}, ExtraTags: []string{"elevator_shaft"}},
		{Keywords: []string{"schachttuer", "fahrkorbtuer", "aufzugstuer"}, ExtraTags: []string{"elevator_door"}},
		{Keywords: []string{"treibscheibe", "tragseil", "aufzugsseil"}, ExtraTags: []string{"elevator_traction"}},
		{Keywords: []string{"gegengewicht"}, ExtraTags: []string{"counterweight"}},
		{Keywords: []string{"traktor", "schlepper"}, ExtraTags: []string{"agri_tractor"}},
		{Keywords: []string{"maehdrescher", "feldhaecksler"}, ExtraTags: []string{"agri_harvester"}},
		{Keywords: []string{"ballenpresse"}, ExtraTags: []string{"agri_baler"}},
		{Keywords: []string{"holzhaecksler", "astschredder"}, ExtraTags: []string{"agri_chipper"}},
		{Keywords: []string{"getreidefoerder", "kornelevator"}, ExtraTags: []string{"agri_grain"}},
		{Keywords: []string{"futtersilo", "getreidesilo"}, ExtraTags: []string{"agri_silo"}},
		{Keywords: []string{"feldspritze", "pflanzenschutzspritze"}, ExtraTags: []string{"agri_sprayer"}},
		{Keywords: []string{"duengerstreuer", "duengestreuer"}, ExtraTags: []string{"agri_spreader"}},
		{Keywords: []string{"bodenfraese", "kreiselegge"}, ExtraTags: []string{"agri_tiller"}},
		{Keywords: []string{"kreiselmaeher", "scheibenmaeher", "maehwerk"}, ExtraTags: []string{"agri_mower"}},
		{Keywords: []string{"spruehduese", "spritzduese", "spruehkopf"}, ExtraTags: []string{"spray_nozzle"}},
		{Keywords: []string{"galvanikbad", "tauchbad", "beizbad", "chemiebad"}, ExtraTags: []string{"chemical_bath"}},
		{Keywords: []string{"batterie", "akku", "akkumulator", "traktionsbatterie", "lithium", "batteriespeicher", "hochvoltbatterie", "lithium-batterie"}, ExtraTags: []string{"battery"}},
		{Keywords: []string{"heizelement", "heizpatrone", "heizband"}, ExtraTags: []string{"heating_element"}},
		{Keywords: []string{"uv-lampe", "uv-strahler", "uv-c-strahler"}, ExtraTags: []string{"uv_source"}},
		{Keywords: []string{"roentgen", "radioaktiv", "strahlenquelle", "gammastrahl", "isotop"}, ExtraTags: []string{"radiation_source"}},
		{Keywords: []string{"staubexplosion", "staubentwicklung", "feinstaub"}, ExtraTags: []string{"dust_risk"}},
		{Keywords: []string{"grossbehaelter", "transportbehaelter", "gebinde"}, ExtraTags: []string{"container"}},
		{Keywords: []string{"fahrgestell"}, ExtraTags: []string{"chassis"}},
		{Keywords: []string{"spinnmaschine", "webmaschine", "textilmaschine", "spinnerei"}, ExtraTags: []string{"moving_mechanical_parts", "rotating_element"}},
		{Keywords: []string{"wartung", "instandhaltung", "instandsetzung"}, ExtraTags: []string{"maintenance"}},
		{Keywords: []string{"ruettel", "vibration", "vibrationsfoerderer"}, ComponentIDs: []string{"C125"}, ExtraTags: []string{"vibration_source", "noise_source"}},
		{Keywords: []string{"fallrohr", "auswurf", "chute"}, ComponentIDs: []string{"C129"}, EnergyIDs: []string{"EN04"}, ExtraTags: []string{"gravity_risk"}},
		{Keywords: []string{"kistenwechsel", "bin change"}, ComponentIDs: []string{"C134"}, ExtraTags: []string{"ergonomic", "gravity_risk"}},
		{Keywords: []string{"drehtisch", "rotary table"}, ComponentIDs: []string{"C004"}, EnergyIDs: []string{"EN02"}, ExtraTags: []string{"rotating_part"}},
		{Keywords: []string{"linearachse", "linear axis"}, ComponentIDs: []string{"C005"}, EnergyIDs: []string{"EN01"}, ExtraTags: []string{"crush_point"}},
		{Keywords: []string{"waage", "wiege", "scale", "pruefstation"}, ComponentIDs: []string{"C135"}, ExtraTags: []string{"sensor_part"}},

		// ── Antriebe ────────────────────────────────────────────────────
		{Keywords: []string{"motor", "elektromotor", "drehstrom"}, ComponentIDs: []string{"C031"}, EnergyIDs: []string{"EN02", "EN05"}, ExtraTags: []string{"rotating_part"}},
		{Keywords: []string{"servomotor", "servo"}, ComponentIDs: []string{"C032"}, EnergyIDs: []string{"EN02"}, ExtraTags: []string{"rotating_part", "high_speed"}},
		{Keywords: []string{"frequenzumrichter", "vfd", "inverter"}, ComponentIDs: []string{"C034"}, EnergyIDs: []string{"EN05"}, ExtraTags: []string{"electrical_part"}},
		{Keywords: []string{"getriebe", "gearbox"}, ComponentIDs: []string{"C035"}, EnergyIDs: []string{"EN02"}, ExtraTags: []string{"rotating_part"}},
		{Keywords: []string{"riemen", "belt drive"}, ComponentIDs: []string{"C040"}, EnergyIDs: []string{"EN02"}, ExtraTags: []string{"entanglement_risk"}},

		// ── Hydraulik ───────────────────────────────────────────────────
		{Keywords: []string{"hydraulik", "hydraulisch", "hydraulic"}, ComponentIDs: []string{"C041"}, EnergyIDs: []string{"EN07"}, ExtraTags: []string{"hydraulic_part", "high_pressure"}},
		{Keywords: []string{"hydraulikpumpe", "hydraulic pump"}, ComponentIDs: []string{"C041"}, EnergyIDs: []string{"EN07"}, ExtraTags: []string{"hydraulic_part"}},
		{Keywords: []string{"hydraulikzylinder", "hydraulic cylinder"}, ComponentIDs: []string{"C042"}, EnergyIDs: []string{"EN07"}, ExtraTags: []string{"hydraulic_part", "moving_part"}},
		{Keywords: []string{"hydraulikventil", "hydraulic valve"}, ComponentIDs: []string{"C043"}, EnergyIDs: []string{"EN07"}, ExtraTags: []string{"hydraulic_part"}},
		{Keywords: []string{"hydraulikspeicher", "accumulator"}, ComponentIDs: []string{"C044"}, EnergyIDs: []string{"EN07", "EN10"}, ExtraTags: []string{"stored_energy", "rapid_energy_release"}},
		{Keywords: []string{"hydraulikschlauch", "hose"}, ComponentIDs: []string{"C045"}, ExtraTags: []string{"hydraulic_part"}},
		{Keywords: []string{"druckbegrenzung", "pressure relief"}, ComponentIDs: []string{"C131"}, ExtraTags: []string{"safety_device"}},
		{Keywords: []string{"schmier", "lubrication", "schmieranlage"}, ComponentIDs: []string{"C123"}, EnergyIDs: []string{"EN07"}, ExtraTags: []string{"oil_mist_risk"}},
		{Keywords: []string{"oelfang", "auffangwanne", "drip tray"}, ComponentIDs: []string{"C130"}, ExtraTags: []string{"chemical_risk"}},

		// ── Pneumatik ───────────────────────────────────────────────────
		{Keywords: []string{"pneumatik", "pneumatisch", "pneumatic"}, ComponentIDs: []string{"C051"}, EnergyIDs: []string{"EN08"}, ExtraTags: []string{"pneumatic_part"}},
		{Keywords: []string{"kompressor", "compressor", "druckluft"}, ComponentIDs: []string{"C052"}, EnergyIDs: []string{"EN08"}, ExtraTags: []string{"noise_source"}},
		{Keywords: []string{"vakuum", "vacuum", "sauger"}, ComponentIDs: []string{"C055"}, EnergyIDs: []string{"EN08"}, ExtraTags: []string{}},

		// ── Elektrik ────────────────────────────────────────────────────
		{Keywords: []string{"schaltschrank", "cabinet", "electrical cabinet"}, ComponentIDs: []string{"C061"}, EnergyIDs: []string{"EN05"}, ExtraTags: []string{"high_voltage", "electrical_part"}},
		{Keywords: []string{"stromversorgung", "power supply"}, ComponentIDs: []string{"C062"}, EnergyIDs: []string{"EN05"}, ExtraTags: []string{"electrical_part"}},
		{Keywords: []string{"transformator", "transformer"}, ComponentIDs: []string{"C063"}, EnergyIDs: []string{"EN05"}, ExtraTags: []string{"high_voltage"}},
		{Keywords: []string{"hauptschalter", "main switch"}, ComponentIDs: []string{"C070"}, EnergyIDs: []string{"EN05"}, ExtraTags: []string{"electrical_part"}},
		{Keywords: []string{"fi-schutz", "rcd", "fehlerstrom"}, ComponentIDs: []string{"C066"}, ExtraTags: []string{"safety_device"}},
		{Keywords: []string{"usv", "ups"}, ComponentIDs: []string{"C067"}, EnergyIDs: []string{"EN09"}, ExtraTags: []string{"stored_energy"}},

		// ── Steuerung / SPS ─────────────────────────────────────────────
		{Keywords: []string{"sps", "plc", "steuerung", "speicherprogrammierbar"}, ComponentIDs: []string{"C071"}, ExtraTags: []string{"has_software", "programmable"}},
		{Keywords: []string{"sicherheits-sps", "safety plc", "f-sps"}, ComponentIDs: []string{"C072"}, ExtraTags: []string{"has_software", "safety_device"}},
		{Keywords: []string{"hmi", "bedienfeld", "bedienpanel", "touchpanel"}, ComponentIDs: []string{"C073"}, ExtraTags: []string{"user_interface"}},
		{Keywords: []string{"bedienpult", "control desk"}, ComponentIDs: []string{"C079"}, ExtraTags: []string{"user_interface"}},

		// ── Sensorik ────────────────────────────────────────────────────
		{Keywords: []string{"positionssensor", "position sensor", "initiator"}, ComponentIDs: []string{"C081"}, ExtraTags: []string{"sensor_part"}},
		{Keywords: []string{"kamera", "vision", "bildverarbeitung"}, ComponentIDs: []string{"C082"}, ExtraTags: []string{"sensor_part"}},
		{Keywords: []string{"kraftsensor", "force sensor", "kraftmessdose"}, ComponentIDs: []string{"C083"}, ExtraTags: []string{"sensor_part"}},
		{Keywords: []string{"temperatursensor", "thermocouple"}, ComponentIDs: []string{"C084"}, ExtraTags: []string{"sensor_part"}},
		{Keywords: []string{"drucksensor", "pressure sensor"}, ComponentIDs: []string{"C085"}, ExtraTags: []string{"sensor_part"}},
		{Keywords: []string{"drehgeber", "encoder"}, ComponentIDs: []string{"C086"}, ExtraTags: []string{"sensor_part"}},
		{Keywords: []string{"laserscanner", "laser scanner"}, ComponentIDs: []string{"C087"}, ExtraTags: []string{"sensor_part", "safety_device"}},

		// ── Sicherheitseinrichtungen ────────────────────────────────────
		{Keywords: []string{"not-halt", "not-aus", "emergency stop", "e-stop"}, ComponentIDs: []string{"C101"}, ExtraTags: []string{"safety_device", "emergency_stop"}},
		{Keywords: []string{"lichtgitter", "lichtvorhang", "light curtain", "light grid"}, ComponentIDs: []string{"C102"}, ExtraTags: []string{"safety_device"}},
		{Keywords: []string{"sicherheitsschalter", "safety switch"}, ComponentIDs: []string{"C104"}, ExtraTags: []string{"safety_device", "interlocked"}},
		{Keywords: []string{"zuhaltung", "guard locking", "interlock"}, ComponentIDs: []string{"C105"}, ExtraTags: []string{"safety_device", "interlocked"}},
		// interlocked_enclosure signals that moving parts are inaccessible behind a
		// guard that is monitored/locked — feeds the GuardableByEnclosure re-scoping
		// (contact/entanglement becomes a maintenance/guard-open hazard, not a
		// normal-operation one). Emitted only by explicit "interlocked door/guard"
		// vocabulary so it does not trigger for machines with exposed motion.
		{Keywords: []string{"tuer mit sicherheitsschalter", "verriegelte tuer", "verriegelte haube", "verriegelte einhausung", "sicherheitstuer", "tuerverriegelung", "haube mit sicherheitsschalter"}, ExtraTags: []string{"interlocked_enclosure"}},
		{Keywords: []string{"zweihand", "two-hand", "zweihandschaltung"}, ComponentIDs: []string{"C106"}, ExtraTags: []string{"safety_device", "two_hand_control_required"}},
		{Keywords: []string{"schaltmatte", "safety mat"}, ComponentIDs: []string{"C108"}, ExtraTags: []string{"safety_device"}},
		{Keywords: []string{"seilzug", "pull wire"}, ComponentIDs: []string{"C109"}, ExtraTags: []string{"safety_device"}},
		{Keywords: []string{"zustimmtaster", "enabling device"}, ComponentIDs: []string{"C110"}, ExtraTags: []string{"safety_device"}},

		// ── Schutzeinrichtungen / Strukturell ───────────────────────────
		{Keywords: []string{"schutzumhausung", "schutzeinhausung", "enclosure"}, ComponentIDs: []string{"C022"}, ExtraTags: []string{"guard", "interlocked"}},
		{Keywords: []string{"schutzgitter", "protective fence", "schutzzaun"}, ComponentIDs: []string{"C028"}, ExtraTags: []string{"guard"}},
		{Keywords: []string{"schutztuer", "safety door", "schutztuer"}, ComponentIDs: []string{"C023"}, ExtraTags: []string{"guard", "interlocked"}},

		// ── Absaugung / Umwelt ──────────────────────────────────────────
		{Keywords: []string{"absaug", "extraction", "abscheider"}, ComponentIDs: []string{"C124"}, ExtraTags: []string{"noise_source"}},
		// "filteranlage" only — bare "filter" falsely mapped any filter (Laugen-,
		// Wasser-, Oel-, Netzfilter) to the oil-mist extractor C124.
		{Keywords: []string{"filteranlage"}, ComponentIDs: []string{"C124"}, ExtraTags: []string{}},

		// ── IT / Netzwerk ───────────────────────────────────────────────
		{Keywords: []string{"switch", "netzwerk"}, ComponentIDs: []string{"C111"}, ExtraTags: []string{"networked"}},
		{Keywords: []string{"firewall"}, ComponentIDs: []string{"C113"}, ExtraTags: []string{"networked"}},
		{Keywords: []string{"iot", "gateway"}, ComponentIDs: []string{"C114"}, ExtraTags: []string{"networked"}},
		{Keywords: []string{"wlan", "wifi", "wireless"}, ComponentIDs: []string{"C116"}, ExtraTags: []string{"wireless"}},
		{Keywords: []string{"opc ua", "opc-ua"}, ComponentIDs: []string{"C117"}, ExtraTags: []string{"networked"}},

		// ── KI / Software ───────────────────────────────────────────────
		{Keywords: []string{"kuenstliche intelligenz", "ki-", "ai ", "machine learning", "neural"}, ComponentIDs: []string{"C119"}, ExtraTags: []string{"has_ai"}},
		{Keywords: []string{"software", "firmware"}, ComponentIDs: []string{}, ExtraTags: []string{"has_software"}},

		// ── Allgemeine Maschinen-Keywords ────────────────────────────────
		{Keywords: []string{"roboter", "robot"}, ComponentIDs: []string{"C001"}, EnergyIDs: []string{"EN01", "EN02"}, ExtraTags: []string{"moving_part", "high_force"}},
		{Keywords: []string{"greifer", "gripper"}, ComponentIDs: []string{"C002"}, ExtraTags: []string{"clamping_part", "pinch_point"}},
		{Keywords: []string{"spindel", "spindle"}, ComponentIDs: []string{"C006"}, EnergyIDs: []string{"EN02"}, ExtraTags: []string{"rotating_part", "high_speed"}},
		{Keywords: []string{"saege", "saw"}, ComponentIDs: []string{"C007"}, ExtraTags: []string{"cutting_part"}},
		// "roller" (English) removed: as a bare substring it false-matches
		// German compounds like "Bodenroller" (a floor dolly) and "Controller",
		// wrongly creating a rotating mill-roller component. "walze" and its
		// compounds are the precise German terms for C009.
		{Keywords: []string{"walze", "kalanderwalze", "walzwerk"}, ComponentIDs: []string{"C009"}, EnergyIDs: []string{"EN02"}, ExtraTags: []string{"rotating_part", "entanglement_risk"}},
		{Keywords: []string{"kette", "chain"}, ComponentIDs: []string{"C010"}, ExtraTags: []string{"entanglement_risk"}},
		{Keywords: []string{"bremse", "brake"}, ComponentIDs: []string{"C013"}, ExtraTags: []string{"safety_device"}},
		{Keywords: []string{"schweiss", "weld"}, ComponentIDs: []string{"C016"}, EnergyIDs: []string{"EN05"}, ExtraTags: []string{"high_temperature"}},
		{Keywords: []string{"biege", "bend"}, ComponentIDs: []string{"C019"}, ExtraTags: []string{"high_force"}},
		{Keywords: []string{"stanz", "stamp", "punch"}, ComponentIDs: []string{"C018"}, ExtraTags: []string{"high_force", "crush_point"}},
		{Keywords: []string{"heiz", "heater", "heating"}, ComponentIDs: []string{"C094"}, EnergyIDs: []string{"EN06"}, ExtraTags: []string{"high_temperature"}},
		// Cooling UNIT only — not the bare adjectives "kuehl"/"cool", which falsely
		// matched product-variant names ("Cool-Ausfuehrung") and outputs ("kuehle
		// Glaeser"). Keyword->component must name an actual component.
		{Keywords: []string{"kuehlaggregat", "kuehlanlage", "kuehler", "kaeltemaschine", "chiller", "rueckkuehl"}, ComponentIDs: []string{"C095"}, ExtraTags: []string{}},
		{Keywords: []string{"luefter", "fan", "geblaese"}, ComponentIDs: []string{"C096"}, ExtraTags: []string{"rotating_part", "noise_source"}},
		{Keywords: []string{"spannvorrichtung", "fixture", "clamp"}, ComponentIDs: []string{"C100"}, ExtraTags: []string{"clamping_part"}},

		// ── Cobot / Kollaborativer Betrieb ──────────────────────────────
		{Keywords: []string{"kollaborier", "kollaboration", "collaborative"}, ComponentIDs: []string{"C139"}, ExtraTags: []string{"collaborative_operation", "force_limited"}},
		{Keywords: []string{"cobot"}, ComponentIDs: []string{"C139"}, ExtraTags: []string{"collaborative_operation"}},
		{Keywords: []string{"endeffektor", "end effector", "werkzeug am roboter"}, ComponentIDs: []string{"C136"}, ExtraTags: []string{"tool_at_robot"}},
		{Keywords: []string{"werkstueck", "workpiece"}, ComponentIDs: []string{"C137"}, ExtraTags: []string{"variable_workpiece"}},
		{Keywords: []string{"sicherheitsscanner", "safety scanner"}, ComponentIDs: []string{"C138"}, ExtraTags: []string{"safety_device"}},
		{Keywords: []string{"kraftsensor", "momentsensor", "force sensor", "torque sensor"}, ComponentIDs: []string{"C140"}, ExtraTags: []string{"force_limited"}},
		{Keywords: []string{"nachlauf", "afterrun"}, ExtraTags: []string{"afterrun_risk"}},
		{Keywords: []string{"traglast", "payload"}, ExtraTags: []string{"gravity_risk"}},
		{Keywords: []string{"reichweite", "reach"}, ExtraTags: []string{"moving_part"}},

		// ── Elektromotor-spezifisch ─────────────────────────────────���───
		{Keywords: []string{"elektromotor", "electric motor", "asynchronmotor", "synchronmotor"}, ComponentIDs: []string{"C031"}, EnergyIDs: []string{"EN02", "EN05"}, ExtraTags: []string{"rotating_part"}},
		{Keywords: []string{"wicklung", "winding", "stator", "rotor"}, ComponentIDs: []string{"C031"}, EnergyIDs: []string{"EN05"}, ExtraTags: []string{"rotating_part", "high_voltage"}},
		{Keywords: []string{"lager", "bearing", "waelzlager", "kugellager"}, ComponentIDs: []string{"C013"}, ExtraTags: []string{"rotating_part"}},
		{Keywords: []string{"luefter", "ventilator", "kuehlung"}, ComponentIDs: []string{"C096"}, ExtraTags: []string{"rotating_part", "noise_source"}},
		{Keywords: []string{"klemmenkasten", "terminal box"}, ComponentIDs: []string{"C061"}, EnergyIDs: []string{"EN05"}, ExtraTags: []string{"high_voltage"}},
		{Keywords: []string{"welle", "shaft", "abtriebswelle"}, ComponentIDs: []string{"C031"}, EnergyIDs: []string{"EN02"}, ExtraTags: []string{"rotating_part", "entanglement_risk"}},
		{Keywords: []string{"drehmoment", "torque"}, EnergyIDs: []string{"EN02"}, ExtraTags: []string{"high_force", "rotating_part"}},
		{Keywords: []string{"isolierung", "insulation"}, ExtraTags: []string{"high_voltage"}},

		// ── Kontext-Keywords (keine Komponente, nur Tags) ───────────────
		{Keywords: []string{"vollautomatisch", "automatisch"}, ExtraTags: []string{"auto_operation"}},
		{Keywords: []string{"schutzausruestung", "psa", "ppe"}, ExtraTags: []string{"ppe_required"}},
		{Keywords: []string{"gehoerschutz", "hearing protection"}, ExtraTags: []string{"noise_source", "ppe_required"}},
		{Keywords: []string{"sicherheitsschuh", "safety shoe"}, ExtraTags: []string{"ppe_required"}},
		{Keywords: []string{"fehlanwendung", "misuse"}, ExtraTags: []string{"bypass_risk"}},
		{Keywords: []string{"umgehung", "bypass"}, ExtraTags: []string{"bypass_risk"}},
		{Keywords: []string{"explosion", "explosionsgefaehrd"}, ExtraTags: []string{"chemical_risk"}},
		{Keywords: []string{"flurfoerderfahrzeug", "forklift", "gabelstapler"}, ExtraTags: []string{"moving_part", "gravity_risk"}},
	}
}
