hassil icon indicating copy to clipboard operation
hassil copied to clipboard

Case-folding ß becomes ss

Open synesthesiam opened this issue 3 years ago • 2 comments

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.

synesthesiam avatar Mar 06 '23 16:03 synesthesiam

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 avatar Mar 06 '23 19:03 mib1185

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

mib1185 avatar Mar 06 '23 19:03 mib1185

hassil 2.0 no longer case folds

synesthesiam avatar Nov 20 '24 17:11 synesthesiam