Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate no matching syntax in fixture names #164

Closed
wants to merge 1 commit into from

Conversation

balloob
Copy link
Member

@balloob balloob commented Dec 28, 2022

This updates the validator to catch matching syntax being used in fixture names.

Although our parser allows fixtures with parsing syntax, it's not something Home Assistant would ever provide.

We need a solution where we can define a format how nouns are transformed.

See files changed for languages that fail validation.

@HepoH3
Copy link
Member

HepoH3 commented Dec 29, 2022

Russian language have similar grammar and will fail validation, bacause I used the same hack as mentioned in #158 (comment)
Additionaly I had to use another hack with color cases:

- in: "белый | белого"

The problem is that it's not only Zone naming problem, but every entity in the house. If it was just zones, we could ask user to specify all word cases for zone, but it's unreallistic to specify all entities cases.

Another thing is, that it's not only noun words problem, but adjectives linked to the noun too:

turn on *red boiler*
what temperature in the *red boiler*?
set *red boiler* temperature to 60 celcius
включи *красн[ый] бойлер[]*
какая температура в *красн[ом] бойлер[е]*?
установи температуру *красн[ого] бойлер[а]* до 60 градусов цельсия

I believe the problem need to be solve with something like this. This algorithm will get base part of the word (root of the word).
Moreover those page raise another russian language feature: usage of the literal ё. This letter is rarely used and should be mapped to е(do not confuse with latin letter e). It's not ambiguous, and will simplify patterns like this:

- in: "черный | черного | чёрный | чёрного"

Or maybe we need to develop set of language flags that will modify grammar parsing rules. I think there will be another diffuculties in other languages, for slavonic languages it could be:

language: pl/ru/sk/uk/etc
has_adj_noun_cases: true
...

and that flag will indicate that when you copmare setnence part against homeassistant entities it will check that both parts starts_with same root of the word.

@balloob balloob force-pushed the validate-fixture-names-no-matching-syntax branch from 1e5ea41 to 1043062 Compare January 10, 2023 02:04
@balloob
Copy link
Member Author

balloob commented Jan 10, 2023

(rebased to get a new list of languages that require a solution)

@balloob balloob force-pushed the validate-fixture-names-no-matching-syntax branch from 1043062 to a98a61f Compare January 23, 2023 14:11
@balloob balloob force-pushed the validate-fixture-names-no-matching-syntax branch from a98a61f to 60c67ef Compare March 7, 2025 14:53
@balloob balloob closed this Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants