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

key error for Finnish #38

Open
ali-unlu opened this issue Jun 22, 2022 · 1 comment
Open

key error for Finnish #38

ali-unlu opened this issue Jun 22, 2022 · 1 comment

Comments

@ali-unlu
Copy link

I install as suggested in your GitHub page (also tested on Google Colab) but there is a problem with the Finnish language

from afinn import Afinn
afinn = Afinn(language = 'fi')
afinn.score('Siellä on uusi hyvä juttu, katsokaa ja kuunnelkaa ihmeessä.')

Here is the results

KeyError Traceback (most recent call last)
Input In [11], in <cell line: 2>()
1 from afinn import Afinn
----> 2 afinn = Afinn(language = 'fi')
3 afinn.score('Siellä on uusi hyvä juttu, katsokaa ja kuunnelkaa ihmeessä.')

File ~/opt/anaconda3/lib/python3.9/site-packages/afinn/afinn.py:72, in Afinn.init(self, language, emoticons, word_boundary)
57 def init(self, language="en", emoticons=False, word_boundary=True):
58 """Setup dictionary from data file.
59
60 The language parameter can be set to English (en) or Danish (da).
(...)
70
71 """
---> 72 filename = LANGUAGE_TO_FILENAME[language]
73 full_filename = self.full_filename(filename)
74 if emoticons:
75 # Words

KeyError: 'fi'

@fnielsen
Copy link
Owner

The PyPI package is not updated to Finish (I ought to do that). In the mean time: The GitHub version can be clone or installed and has the Finish support.

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

2 participants