home-assistant / hassil

Intent parsing for Home Assistant
Apache License 2.0
86 stars 15 forks source link

Case-folding ß becomes ss #37

Open synesthesiam opened 1 year ago

synesthesiam commented 1 year ago

Issue for https://github.com/home-assistant/intents/issues/1133

Hassil normalizes text before matching with casefold, but this will expand "ß" to "ss" in German.

A copy of the original text should be kept, and some method for tracking the correspondence between the original and normalized texts is needed.

mib1185 commented 1 year ago

it seems that only the response text is normlized, because the slot.name is correct 🤔

$ python3 -m script.intentfest parse --language de --sentence 'wie ist die Außentemperatur?'
{
  "text": "wie ist die Außentemperatur?",
  "match": true,
  "intent": "HassGetState",
  "slots": {
    "name": "Außentemperatur"
  },
  "context": {
    "domain": "sensor",
    "unit_of_measurement": "°C"
  },
  "response_key": "einzeln",
  "response": "Aussentemperatur ist 21 °C"
}
mib1185 commented 1 year ago

or is the slot.name evaluated before any matching occur?