errata-ai / vale

:pencil: A markup-aware linter for prose built with speed and extensibility in mind.
https://vale.sh
MIT License
4.52k stars 155 forks source link

Cannot use hunspell French dictionaries #862

Open jphbutler64 opened 4 months ago

jphbutler64 commented 4 months ago

Check for existing issues

Environment

Linux Ubuntu 22.04.2 LTS vale version 2.28.0 Hunspell 1.7.0 dictionaries supplied with the linux distro

Describe the bug / provide steps to reproduce it

The standard French dictionaries fr_FR, fr_CH etc do not work with vale.

Using this configuration:

extends: spelling
message: "'%s' is a typo"
dicpath: /usr/share/hunspell
dictionaries:
    - fr_FR

yields:

E201 Invalid value [/home/jpbutler/styles/philip/Basic.yml:1:1]:
   1* extends: spelling
   2  message: "'%s' is a typo"
   3  dicpath: /usr/share/hunspell
NOSUGGEST stanza had more than one flag: "--"
Execution stopped with code 1.

The English dictionaries work fine with my vale setup, and the French dictionaries work well with hunspell. fr_FR.dic contains 586 lines with -- as part of the description of the inflexions (out of 84140 entries). fr_FR.aff contains a single line with --, which is NOSUGGEST --.

As a workaround, I removed all -- lines in the dic and aff lines, but I then loose an awful lot inflections, making eg. all plurals unrecogniosable in vale and missing many of the most common invariant words etc. I have also tried replacing -- with £, @ or ~, in th e dic and aff files, but without any luck either.