EWSoftware / VSSpellChecker

A Visual Studio spell checker editor extension that checks the spelling of comments, strings, and plain text as you type. Supports configuration and various languages.
Other
377 stars 65 forks source link

Problems with dictionary entries ending in hyphen #230

Closed mdro closed 2 years ago

mdro commented 3 years ago

At least the German (de-DE) dictionary contains some entries that end with a hyphen to signal that this word may only appear as part of a compound word. Usually these words are special variations of nouns that are used to make compound words easier to pronounce: Versicherung + Vertrag = Versicherungsvertrag.

VS Spellchecker normally accepts compound words with these special parts. The problems appear when such a compound word gets hyphenated for line breaking or readability (for very long compounds): In "Versicherungs-Vertrag" the spell checker complains about "Versicherungs" and suggests "Versicherungs-". If you accept that suggestion it adds a second hyphen and complains about "Versicherungs" again.

EWSoftware commented 3 years ago

Not being a German speaker, I need some suggestions about solutions. Is it enough to ignore the misspelling if a suggestion comes back with a word matching the misspelling but with a hyphen on the end or is there more to it? A hyphen is a word break so regardless of language, it will flag words on either side of it as misspelled if they don't appear in the dictionary whether or not there's a line break after the hyphen in the text.

mdro commented 3 years ago

Ignoring if the suggestion is "add hyphen" should fix the false positive, but what happens if the word is really misused as standalone? I'd refine it to: Ignore if the suggestion is "add hyphen" and the next char is already a hyphen.

If the next char isn't available at the point where you plan to supress the error, supressing all "add hyphen" cases is ok. IMO false positives are worse than false negatives because you have to keep ignoring them.