Tad Lispy
Tad Lispy

Reputation: 3074

Check spelling of words containing a period (dot) character on the command line

I'm trying to get our CI/CD pipeline to spell check a website. To make it work we need a custom dictionary of correct words e.g. names of products. I tried Aspell and Hunspell, but in both cases I've ran into the same problem - names with period in them, e.g. "Node.js". It's considered to be two words: "Node" and "js", where second is incorrect.

I'd like to make a list of words like that so they are considered correct. Some considerations:

Here's what I have so far (not working):

The sample.txt file with some spelling errors:

The cat was on the rooof with Fana. They were using Node.js to do their shtuff.

Custom dictionary for Aspell (custom.pws):

personal_ws-1.1 en 2
Fana
Node.js
$ aspell list --home-dir=. --personal=custom.pws sample.txt
Error: ./custom.pws: The word "Node.js" is invalid. The character '.' (U+2E) may not appear in the middle of a word.

Custom dictionary for Hunspell (custom.dic):

Fana
Node.js
$ hunspell -p custom.dic -l sample.txt
rooof
js
shtuff

Upvotes: 2

Views: 164

Answers (0)

Related Questions