errata-ai / vale

:pencil: A markup-aware linter for prose built with speed and extensibility in mind.

Home Page:https://vale.sh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spelling with hunspell-nl dictionary results in error E201 Invalid value

koenvervloesem opened this issue · comments

Check for existing issues

  • Completed

Environment

  • Ubuntu 22.04.3 LTS
  • Vale installed from PyPI with pip3 install -U vale
  • Vale 3.1.0

Describe the bug / provide steps to reproduce it

I wrote the following rule to add Dutch spelling:

extends: spelling
message: "Bedoelde je echt '%s'?"
level: error
dicpath: /usr/share/hunspell/
dictionaries:
  - nl

I installed the hunspell-nl package (sudo apt install hunspell-nl), which is created by the OpenTaal project.

After running Vale on a Dutch text with this rule enabled, I get the following error:

E201 Invalid value [/home/koan/vale/Koen_NL/spelling.yml:1:1]:

   1* extends: spelling
   2  message: "Bedoelde je echt '%s'?"
   3  level: error

CrossProduct is not Y or N: got "0"

Execution stopped with code 1.

When I change the dictionary to en in the spelling rule, running Vale succeeds, so there's something in the Dutch dictionary file that makes it fail.

Same problem with vale 3.4.2 on Mint21.
Hunspell nl_NL Date and version: 2020-12-24 15:42:49 2.20.18

Problem seems to be in nl_NL.aff. If I remove everything after 'COMPOUNDMIN 0' I get a different error message from Vale
And in nl_NL.dic is a line that causes problems:
CO/<tab>Cw
After removing the TAB Vale checks work.

Did some further testing and Vale doesn't seem to use the FLAG long option from nl.aff. As a result, all flags from nl.dic are handled as single character flags, which can't be found in nl.aff.

For now, please change the error message so that is clear whether the error is in the YML config file or there is a problem within the specified language files.