Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Unexpected inconsistency with some custom dictionary words prefixed with "a " #187

Open
wesbiggs opened this issue Jan 5, 2023 · 0 comments

Comments

@wesbiggs
Copy link

wesbiggs commented Jan 5, 2023

yaspeller exhibits some strange behaviour in some circumstances when checking certain words prefixed with the word "a".

It can be reproduced using the command line invocation.

Setup:

mkdir yaspeller-issue; cd yaspeller-issue
npm init -y
npm i yaspeller
echo '{"dictionary":["blockchain"]}' > .yaspellerrc.json

Test cases:

The word by itself is correctly allowed.

echo "blockchain" | ./node_modules/.bin/yaspeller --stdin -l en
Spelling check:
✓ stdin 379 ms
No errors.
Checking finished: 0.477 sec.

The word prefixed by "a " causes an error.

echo "a blockchain" | ./node_modules/.bin/yaspeller --stdin -l en
Spelling check:
✗ stdin 378 ms
-----
Typos: 1
1. a blockchain (1:1, suggest: black chain)
-----

Fix typo or add word to dictionary at .yaspellerrc.json ("dictionary" property) if you are sure about spelling. Docs: https://github.com/hcodes/yaspeller#configuration
Checking finished: 0.48 sec.

"on a blockchain" is fine.

echo "on a blockchain" | ./node_modules/.bin/yaspeller --stdin -l en
Spelling check:
✓ stdin 375 ms
No errors.
Checking finished: 0.474 sec.

But "by a blockchain" is not.

echo "by a blockchain" | ./node_modules/.bin/yaspeller --stdin -l en
Spelling check:
✗ stdin 374 ms
-----
Typos: 1
1. a blockchain (1:4, suggest: black chain)
-----

Fix typo or add word to dictionary at .yaspellerrc.json ("dictionary" property) if you are sure about spelling. Docs: https://github.com/hcodes/yaspeller#configuration
Checking finished: 0.472 sec.

Tested against version 8.0.1.

Other words that are known to trigger the error in similar circumstances are "blockchains" and "mainnet". However, "mainnets" is OK.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant