Closed revolunet closed 5 years ago
Hmm, are you sure you’re on the latest release? (there was a bug which sounds similar https://github.com/wooorm/nspell/commit/a55923ee37ae5c7746c4fa96ed3d68b3e9f20a30)
Also hi Julien! 👋😅
hi :)
using :
"dictionary-fr": "^2.3.1",
"nspell": "^2.1.2"
but console.log(spell.suggest("preavis")); returns false.
.suggest
should return an array, .correct
could return false, which one’s going on here?
Could be related to the fact that MAP, used in dictionary-fr, is not supported in nspell... But I would think the TRY should still make it work
sorry, wrong copy/paste :)
both method return falsy result in that case.
correct
return false
suggest
return wrong results
var dictionary = require("dictionary-fr");
var nspell = require("nspell");
dictionary(ondictionary);
function ondictionary(err, dict) {
if (err) {
throw err;
}
var spell = nspell(dict);
console.log(spell.correct("préavis"));
console.log(spell.suggest("preavis"));
}
~/D/p/m/c/tests-dicts $ node test.js 17:42:41
false
[ 'préavisa', 'préavise', 'preuves' ]
Huh, in fact. Seems like the dictionary is incorrect.
préavis po:nom is:mas is:inv
should just be préavis
. And grammalecte has other packages that include valid (for hunspell) dictionaries. I’ll try and fix this tomorrow!
tell me if theres any way we can help :)
Released dictionary-fr
with a hopefully working version. Could you check that this one works?
Awesome that fix it. Thanks @wooorm 🙏
Hi there !
Looks like the suggest/correct methods doesnt handle some words in french, like "préavis"
in index.dic we can find :
préavis po:nom is:mas is:inv
but
console.log(spell.correct("preavis"));
returns false.Any idea how to fix this ?