mirror of
https://github.com/home-assistant/core.git
synced 2025-11-13 13:00:11 +00:00
Use aliases when listing pipeline languages (#99672)
This commit is contained in:
@@ -199,3 +199,14 @@ def matches(
|
||||
|
||||
# Score < 0 is not a match
|
||||
return [tag for _dialect, score, tag in scored if score[0] >= 0]
|
||||
|
||||
|
||||
def intersect(languages_1: set[str], languages_2: set[str]) -> set[str]:
|
||||
"""Intersect two sets of languages using is_match for aliases."""
|
||||
languages = set()
|
||||
for lang_1 in languages_1:
|
||||
for lang_2 in languages_2:
|
||||
if is_language_match(lang_1, lang_2):
|
||||
languages.add(lang_1)
|
||||
|
||||
return languages
|
||||
|
||||
Reference in New Issue
Block a user