0

I am trying to create a program using a portuguese dictionary with py enchant. Said portuguese dictionary is not a default dictionary that py enchant comes with, as far as I know. I am struggling to understand how to install a dictionary on windows, since all examples I can find on this site are meant for linux. Any help would be aprecciated. I use the spyder IDE but can use IDLE if it's easier to do it there somehow.

Jolo05
  • 1

1 Answers1

-1

From their docs: https://pyenchant.github.io/pyenchant/install.html

Installing a dictionary:

Let’s assume you want to use PyEnchant on a text written in German.

First, use the Enchant Python API to list known languages and providers:

import enchant
broker = enchant.Broker()
broker.describe()
broker.list_languages()

On Windows, if you have installed PyEnchant from a wheel, you can download the hunspell dictionary files you need (both the .dic and .aff extensions) and put them inside /path/to/enchant/data/mingw/enchant/share/hunspell. You can find many dictionaries in LibreOffice sources.

AC1009
  • 64
  • 3
  • Yes I have seen their docs however I cannot find the path you are supposed to put the files inside. they say to put it in '/path/to/enchant/data/mingw/enchant/share/hunspell' however this is not a path that exists on my pc. I am sorry if I am missing something obvious, but I am a bit of a computer noob. – Jolo05 Nov 11 '21 at 15:31
  • It's all good. Next time you should include in the post that you tried looking for it, that way people can be more helpful lol. Are you looking in the folder where you installed PyEnchant? I don't have that installed, so can't help you find the exact path. You can also install something like "Everything", which searches through your drive, and search for "hunspell". That should lead you straight to it. Or you can try searching through the Windows search, but that never works for me – AC1009 Nov 11 '21 at 15:45
  • If you run from the command line `where python` to get the path to your python installation then it should be in the sub directory `Lib\site-packages\enchant\data\mingw64\share\enchant\hunspell` if you have 64 bit python _(remove the 64 otherwise)_ of that location. – Steve Barnes Sep 10 '22 at 08:09