tbroadley / spellchecker-cli

A command-line tool for spellchecking files.
MIT License
119 stars 16 forks source link

Not getting output for UK spelling when running with en-US #121

Open wnim opened 2 weeks ago

wnim commented 2 weeks ago

Here are the simple steps to reproduce. Make a file with the word "colour" and run the command with en-US.

[bash][DESKTOP-K92NTQJ][~/experiments/typer02/src/assets/][master]
@>>spellchecker -f en_10k.json -l en-US --no-suggestions
Spellchecking 1 file...

en_10k.json: no issues found
[bash][DESKTOP-K92NTQJ][~/experiments/typer02/src/assets/][master]
@>>grep colour en_10k.json
  "colour",
  "colours",
tbroadley commented 2 weeks ago

Thank you for the report!

The project does have a test to check that, if words with UK spelling appear in a .txt file, the spellchecker catches them: https://github.com/tbroadley/spellchecker-cli/blob/e4879b5/test/cli-test.ts#L152-L160

spellchecker-cli doesn't have special logic for parsing JSON files. I'm guessing that the default Retext logic doesn't parse any words to be spellchecked out of the JSON file. So spellchecker-cli doesn't detect any misspellings.