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

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

Closed
rocana95 opened this issue Oct 3, 2019 · 2 comments
Closed

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

rocana95 opened this issue Oct 3, 2019 · 2 comments

Comments

@rocana95
Copy link

rocana95 commented Oct 3, 2019

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
Copy link

same problem here!

@balkian
Copy link
Member

balkian commented Oct 26, 2020

Thank you for reporting.

I'm closing this in favor of #31

@balkian balkian closed this as completed Oct 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants