-
I'm looking for an opportunity for switching from yaspeller to cspell, and I want to reuse my custom dictionary. Yaspeller allowed me to define words using simplified regexp, e.g.:
Is it a way to define the same in cspell? P.s. I of course could define 4 words instead of 1 regexp in the example above, but my language defines lots of prefixes/suffixes/endings, real example in https://github.com/rusrails/rusrails/blob/master/.yaspeller.json#L15 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Great question: Please see: #4942 (comment) I had not realized that It is also possible to write your own word list expansion function:
const wordlist = ['(un|)knownword(s|)'];
function expandWordlist(list) {
// expansion code goes here
}
const config = {
words: expandWordlist(wordlist),
};
export default config; |
Beta Was this translation helpful? Give feedback.
Here is a working example. It loads the words from
words.txt
in the same directory ascspell.config.mjs
and expands them returning a custom dictionary calledcustom-words
.cspell.config.mjs