gsi-upm / sematch

semantic similarity framework for knowledge graph
http://gsi-upm.github.io/sematch/
Other
432 stars 110 forks source link

AttributeError: 'str' object has no attribute 'decode' #26

Closed rocana95 closed 4 years ago

rocana95 commented 5 years ago

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)

ZhecanJamesWang commented 4 years ago

same problem here!

balkian commented 4 years ago

Thank you for reporting.

I'm closing this in favor of #31