You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class WordNetSimilarity:
def multilingual2synset(self, word, lang='spa'):
"""
Map words in different language to wordnet synsets
['als', 'arb', 'cat', 'cmn', 'dan', 'eng', 'eus', 'fas', 'fin', 'fra', 'fre',
'glg', 'heb', 'ind', 'ita', 'jpn', 'nno','nob', 'pol', 'por', 'spa', 'tha', 'zsm']
:param word: a word in different language that has been defined in
Open Multilingual WordNet, using ISO-639 language codes.
:param lang: the language code defined
:return: wordnet synsets.
"""
return wn.synsets(word.decode('utf-8'), lang=lang, pos=wn.NOUN)
The text was updated successfully, but these errors were encountered:
this method raise an exception in python3
class WordNetSimilarity:
def multilingual2synset(self, word, lang='spa'):
"""
Map words in different language to wordnet synsets
['als', 'arb', 'cat', 'cmn', 'dan', 'eng', 'eus', 'fas', 'fin', 'fra', 'fre',
'glg', 'heb', 'ind', 'ita', 'jpn', 'nno','nob', 'pol', 'por', 'spa', 'tha', 'zsm']
:param word: a word in different language that has been defined in
Open Multilingual WordNet, using ISO-639 language codes.
:param lang: the language code defined
:return: wordnet synsets.
"""
return wn.synsets(word.decode('utf-8'), lang=lang, pos=wn.NOUN)
The text was updated successfully, but these errors were encountered: