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

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

@wesbiggs

Description

@wesbiggs

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions