Skip to content

Commit

Permalink
feat: multilingual wordnet
Browse files Browse the repository at this point in the history
check laguage specific wordnets for ['en', 'als', 'arb', 'bg', 'cmn', 'da', 'el', 'fi', 'fr', 'he', 'hr', 'is', 'it', 'it-iwn', 'ja', 'ca', 'eu', 'gl', 'es', 'id', 'zsm', 'nl', 'nn', 'nb', 'pl', 'pt', 'ro', 'lt', 'sk', 'sl', 'sv', 'th']
  • Loading branch information
JarbasAl committed Dec 4, 2024
1 parent 03c3c3c commit 68892c9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from ovos_plugin_manager.templates.language import LanguageTranslator
from ovos_utils.lang import standardize_lang_tag
from ovos_workshop.decorators import intent_handler
from ovos_workshop.skills.common_query_skill import CommonQuerySkill
from ovos_workshop.skills.ovos import OVOSSkill


def download_nltk_resource(res: str, res_type: str = "taggers"):
Expand Down Expand Up @@ -200,7 +200,7 @@ def query(cls, query, pos=wn.NOUN, synset=None, lang: Optional[str] = "en"):
return res


class WordnetSkill(CommonQuerySkill):
class WordnetSkill(OVOSSkill):

def initialize(self):
Wordnet.translator = self.translator
Expand Down Expand Up @@ -325,7 +325,7 @@ def handle_hypernym(self, message):
# 'hyponyms': ['quipo', 'máquina de somar', 'Ossos de Napier', 'Ossos de napier', 'Abaco', 'ábaco'],
# 'hypernyms': ['maquinaria', 'máquina'],
# 'root_hypernyms': ['ente', 'entidade', 'ser'],
# 'definition': None}
# 'definition': "Uma máquina pequena utilizada para cálculos matemáticos"}

# full answer
ans = d.get_data("computer")["definition"]
Expand Down

0 comments on commit 68892c9

Please sign in to comment.