aspell-python icon indicating copy to clipboard operation
aspell-python copied to clipboard

Changing Configkeys to use dictionary in other language

Open riannek opened this issue 8 years ago • 3 comments

Hi, I've got a question, I'm trying to use aspell-python with a Dutch dictionary and wordlist. How can I set the Configkeys 'data-dir' and 'dict-dir' to point to my directories? I've tried to use something like this: aspell.ConfigKeys()[5] = 'C:/TmpInstall/data/' aspell.ConfigKeys()[7] = 'C:/TmpInstall/dict/' But I can't find the right syntax.

Regards, Rianne

riannek avatar Jul 27 '15 09:07 riannek

You have to pass the options via constructor, as described in section "Classes" (https://github.com/WojciechMula/aspell-python#classes).

Changing a configuration of existing speller is not yet supported, there is issue #5 for this feature.

WojciechMula avatar Jul 28 '15 04:07 WojciechMula

Hi, Thanks for the pointer. I can set the dictionary files now, but got a follow-up question immediately.I'm getting this error: Traceback (most recent call last): File "//tsn.tno.nl/Data/Projects/060/0/08675/Werkdocumenten/Sentiment Analysis/Code/Spellchecker.py", line 22, in check(term, language) File "//tsn.tno.nl/Data/Projects/060/0/08675/Werkdocumenten/Sentiment Analysis/Code/Spellchecker.py", line 14, in check s = aspell.Speller(('lang', language),('dict-dir','/Home/Desktops/TmpInstall/dict'), ('data-dir','/Home/Desktops/TmpInstall/data')) aspell.AspellSpellerError: The file "Home/Desktops/TmpInstall/dict/nl.rws" is not in the proper format.

I'm working under Windows and I tried to install the dictionary files using the binaries given at http://aspell.net/win32/ , but apparently it doesn't work like that. Is it possible this way to install dictionaries in other languages, or should it be done completely different?

Thanks,

Rianne

riannek avatar Jul 28 '15 12:07 riannek

Rianne, regarding windows problems check the commit 063d028f602797f9b12fd260702107897594194b, the contributed text by Eric might help you.

WojciechMula avatar Aug 29 '15 17:08 WojciechMula