Am 17.09.2010 um 08:09 schrieb Stephan Witt:

> Am 15.09.2010 um 13:11 schrieb Kornel Benko:
> 
>> Everything works as expected, but some words with "dot" are not recognized 
>> as correct.
>> 
>> Say, I want enter "ggf.". This word is marked as not ok, but right klick 
>> shows as 1. alternative "ggf.". Selecting it I now have "ggf..", but still 
>> marked.
>> 
>> Document language: german
>> Spellchecker: Hunspell
>> 
>> Could not find a way in the gui to allow "." as part of a word.
> 
> I'm trying to solve that issue.
> 
> To fix this I tried to change the spell-check for "word-wise" checkers.
> I test the character directly following the word and pass it onto the speller
> when a "." is detected. Now it works for hunspell. 
> But I'm not sure about Aspell. It didn't help and now the end of sentence is 
> misspelled too.
> A clean solution is not so easy. Perhaps the check with the trailing dot has 
> to be repeated
> without the dot if it failed. Or vice-versa. Not nice...

The patch is as follows. Ok to apply?

Stephan

Index: src/Paragraph.cpp
===================================================================
--- src/Paragraph.cpp   (Revision 35425)
+++ src/Paragraph.cpp   (Arbeitskopie)
@@ -3488,8 +3488,14 @@
                // Ignore words with digits
                // FIXME: make this customizable
                // (note that some checkers ignore words with digits by default)
-               if (!hasDigit(word))
+               if (!hasDigit(word)) {
+                       bool const trailing_dot = to < size() && d->text_[to] 
== '.';
                        result = speller->check(wl);
+                       if (SpellChecker::misspelled(result) && trailing_dot) {
+                               word = word.append(from_ascii("."));
+                               result = speller->check(wl);
+                       }
+               }
                d->setMisspelled(from, to, result);
        } else {
                result = d->speller_state_.getState(from);

Reply via email to