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

fix:standardize_lang #9

Merged
merged 2 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ovos_commonqa/opm.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from ovos_plugin_manager.templates.pipeline import IntentMatch, PipelinePlugin
from ovos_utils import flatten_list
from ovos_utils.log import LOG
from ovos_utils.lang import standardize_lang_tag
from ovos_workshop.app import OVOSAbstractApplication


Expand Down Expand Up @@ -75,6 +76,7 @@ def is_question_like(self, utterance: str, lang: str):
@param lang: language of input
@return: True if input might be a question to handle here
"""
lang = standardize_lang_tag(lang)
# skip utterances with less than 3 words
if len(utterance.split(" ")) < 3:
LOG.debug("utterance has less than 3 words, doesnt look like a question")
Expand All @@ -98,6 +100,7 @@ def match(self, utterances: str, lang: str, message: Message) -> Optional[Intent
Returns:
IntentMatch or None
"""
lang = standardize_lang_tag(lang)
# we call flatten in case someone is sending the old style list of tuples
utterances = flatten_list(utterances)
match = None
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ ovos-workshop>=0.1.7,<2.0.0
ovos-plugin-manager
ovos-bus-client
ovos-config
ovos-utils
ovos-utils>=0.3.4,<1.0.0
Loading