Python PyEnchant Portuguese Dictionary Install

832 Views Asked by At

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.

1

There are 1 best solutions below

3
AC1009 On

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.