rrthomas / enchant

enchant spellchecking library
http://rrthomas.github.io/enchant/
GNU Lesser General Public License v2.1
347 stars 59 forks source link

Add custom dictionary support for Aspell #369

Open rrthomas opened 6 months ago

rrthomas commented 6 months ago

This depends on a new API being added to Aspell: https://github.com/GNUAspell/aspell/issues/646

david-vicente commented 5 months ago

I don't know if this is related or not, but my native language (European Portuguese) recently went through a reform and because of that dictionary providers offer the prereform and postreform variants of the European Portuguese dictionary.

For GNU Aspell you can download the dictionaries here: link

In order to differentiate between dictionary files, the providers call the new variant pt_PT and the old variant pt_PT-preao. For example if I execute on my machine:

$ aspell dicts

I get

en
en_GB
en_US
pt_BR
pt_PT
pt_PT-preao

And I can run Aspell in ispell -a compatibility mode while using such a dictionary by executing:

$ aspell -a -d pt_PT-preao

Nonetheless, even if I edit the enchant.ordering file in order to try and use the old variant pt_PT-preao dict, Enchant falls back to the new variant.

Note: It might be useful to know that running

aspell -a -l pt_PT-preao

also falls back to the new variant. Notice the -l instead of -d.

rrthomas commented 5 months ago

This is not related: custom dictionary support refers to user-installed dictionary files, whereas you're talking about non-standard dictionary tags, which should be supported in Enchant ≥ 2.6.1. Please test with such a version and report a bug if you have problems.

david-vicente commented 5 months ago

I can confirm that enchant-2 -a -d pt_PT-preao works. Thank you! And sorry for the off-topic.