Skip to content

Commit

Permalink
fix: drop lingua_franca (#268)
Browse files Browse the repository at this point in the history
* fix: drop lingua_franca

* fix: localization

* Update ovos.py
  • Loading branch information
JarbasAl authored Nov 11, 2024
1 parent f77e498 commit 5df2cd4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
16 changes: 3 additions & 13 deletions ovos_workshop/skills/ovos.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
import binascii
from json_database import JsonStorage
from langcodes import closest_match
from lingua_franca.format import pronounce_number, join_list
from lingua_franca.parse import yes_or_no, extract_number
from ovos_number_parser import pronounce_number, extract_number
from ovos_yes_no_solver import YesNoSolver
from ovos_bus_client import MessageBusClient
from ovos_bus_client.apis.enclosure import EnclosureAPI
from ovos_bus_client.apis.gui import GUIInterface
Expand Down Expand Up @@ -2012,17 +2012,7 @@ def ask_yesno(self, prompt: str,
'no', including a response of None.
"""
resp = self.get_response(dialog=prompt, data=data)
# TODO - lingua_franca does not support standardized lang tags
# deprecate it, use a plugin here https://github.com/TigreGotico/ovos-solver-YesNo-plugin
lf_langs = ("az-az", "ca-es", "cs-cz", "da-dk", "de-de",
"en-us", "es-es", "fr-fr",
"hu-hu", "it-it", "nl-nl", "pl-pl",
"fa-ir", "pt-pt", "ru-ru", "sl-si",
"sv-se", "tr-tr", "eu-eu", "uk-ua")
lang, score = closest_match(self.lang, lf_langs)
if score > 10:
lang = self.lang # let it raise a value Error in next line
answer = yes_or_no(resp, lang=lang) if resp else resp
answer = YesNoSolver().match_yes_or_no(resp, lang=self.lang) if resp else resp
if answer is True:
return "yes"
elif answer is False:
Expand Down
3 changes: 2 additions & 1 deletion requirements/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ ovos-utils>= 0.2.1,<1.0.0
ovos_bus_client>=0.0.8,<2.0.0
ovos-config>=0.0.12,<1.0.0
ovos-backend-client>=0.1.0,<2.0.0
ovos-lingua-franca>=0.4.6,<1.0.0
ovos-solver-yes-no-plugin>=0.0.1,<1.0.0
ovos-number-parser>=0.0.1,<1.0.0
rapidfuzz
langcodes
padacioso

0 comments on commit 5df2cd4

Please sign in to comment.