You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
nspell sometimes fails to add words to the German dictionary (taken from wooorm/dictionaries).
The gist of the bug is that nspell fails to add words to the German dictionary if those words are lowercase forms of words that should be capitalised (nouns in German are always capitalised).
The test words used in the repo are "zeit" and "kablam". Adding "kablam" works as expected and the same is true for other words that do not have a correct German form. Adding "zeit" (or "brot") both exhibit the bug, and the thing they have in common is that they are both German nouns that should be capitalised.
Use the following code after loading the DE dictionary:
constnspell=require('nspell')constdictionaryDe=require('dictionary-de')// wrap dictionary functions so we can populate languageCodes in order of dictionaries loaded// (dictionary callbacks return error or dictionary only)functiononload(err,dictionary){constspell=nspell(dictionary)spell.correct('zeit')spell.add('zeit')if(!spell.correct('zeit'))console.log('\x1b[31m%s\x1b[0m',`"zeit" still incorrect!`)spell.remove('zeit')spell.add('zeit')if(spell.correct('zeit'))console.log('\x1b[32m%s\x1b[0m',`"zeit" is now correct (after removing and then adding it again)`)spell.correct('kablam')spell.add('kablam')if(spell.correct('kablam'))console.log('\x1b[32m%s\x1b[0m',`"kablam" is now correct`)}dictionaryDe(onload)
Work Around
The work around is to remove the word from the dictionary if it is still incorrect, which will allow us to add it successfully and have it marked as correct by nspell.
The text was updated successfully, but these errors were encountered:
@wooorm I have removed the other comment and updated the description to be exact after narrowing this down. What a head spin, I was sure it was something on my end - perhaps the new German dictionary has some funky rules? Enjoy your weekend!
Description
nspell sometimes fails to add words to the German dictionary (taken from wooorm/dictionaries).
The gist of the bug is that nspell fails to add words to the German dictionary if those words are lowercase forms of words that should be capitalised (nouns in German are always capitalised).
The test words used in the repo are "zeit" and "kablam". Adding "kablam" works as expected and the same is true for other words that do not have a correct German form. Adding "zeit" (or "brot") both exhibit the bug, and the thing they have in common is that they are both German nouns that should be capitalised.
Reproduction Steps and Code
This is the test repo with the code required to reproduce the bug.
npm install nspell
npm install dictionary-de
- installs the German dictionary from https://github.com/wooorm/dictionaries/tree/main/dictionaries/deWork Around
The work around is to remove the word from the dictionary if it is still incorrect, which will allow us to add it successfully and have it marked as correct by nspell.
The text was updated successfully, but these errors were encountered: