Issue 49897

Summary: Spelling Replace All also replaces punctuation dot
Product: Writer Reporter: ftack <ftack>
Component: codeAssignee: AOO issues mailing list <issues>
Status: CONFIRMED --- QA Contact:
Severity: Trivial    
Priority: P3 CC: issues, pavel, thomas.lange
Version: OOo 2.0 Beta   
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---

Description ftack 2005-05-26 11:31:40 UTC
Writer 1.9.104 on Windows XP sp2.

When replacing a faulty spelled word at the end of the sentence, the punctuation
is highlighted along and removed when replacing with a suggestion.

To reproduce the error:
Open a blank document with language setting to English (USA) (other languages
have similar issues).

Enter following lines of text

Look I am hewe.
Look I am hewe again.
Look am hewe.
Look l am hewe...
Look Hewe l am.
Hewe I am, Look.

Run spell check using F7. hewe is highlighted (along with the dot!). Click
"here" under suggestions, then "change all". The dot is gone on the first line.
On the fourth line, one of the the dots has disappeared. The exclamation on line
3 stays inact.

Strangly, the capitalised instances of Hewe are not recognized as a spelling
mistake.

This is a severe issue as it corrupts the user data and introduces new errors
that can't be corrected but by detailled proofreading again after the spell check.

There remain several issues with the current spellchecking. Considering "one
problem, one issue" I will post these in different "issues.
Comment 1 michael.ruess 2005-05-26 14:36:57 UTC
Reassigned to SBA.
Comment 2 jack.warchold 2005-05-26 16:37:59 UTC
confirmed on the OOo1.9.106 build (works fine with Staroffice Src680_m106). 
assigned to os.
Comment 3 jack.warchold 2005-07-21 15:27:29 UTC
confirmed in src680_m119
reassigned to khendricks

Comment 4 pavel 2006-01-18 20:14:00 UTC
Daniel: can you please test this?

Moving target to OOoLater. Please change the target accordingly.
Comment 5 ooolist2007 2006-01-18 21:54:51 UTC
I can confirm with m150, but I don't have time and knowledge to debug this,  
sorry. Trying it in hunspell (command line) only the word is highlighted, not 
the dot. 
 
Comment 6 thomas.lange 2006-01-19 10:28:49 UTC
For the problem with "Look l am hewe..." being displayed messed up in the dialog
I have submitted issue 60810.

Hewe being accepted in "Look Hewe l am." is because in OOo spellchecking is
still word based. There is no way to know that here Hewe was inside of a
sentence and thus should have written in lowercase.
In general: if a word is wrong only because it is written in uppercase (i.e. the
spellchecker returns the specific type SpellFailure::CAPTION_ERROR and the and
the start with a uppercase letter) we allow for it because it just might be that
this is a word at the start of a sentence. Handling it this way seemed much
better than having almost every word at the beginning of a sentence marked as wrong.

The other issue related to the described problem is that because of
abbreviations like "e.g." that should be recognized by the spellchecker as being
correct the "." character does not function as a word brekak in general (in the
end this is language dependend and depends on the respective implementation of
the breakiterator).
Because of this at the end of a sentence the following "." character is included
as part as word that is being passed on to the spellchecker.

Since usually the dictionary entries have not that additional character the
process to check words should include the following as part of the process:
- check if the word is correct as it was written (thus having "e.g." being
accepted for 
  example).
- if the word is not accepted but it ends with "." strip all (possibly multiple)
"." 
  characters from the word before checking it again. But remember what you exactly
  have cut off at the end.
  If the word is accepted now we consider everything being Ok.
  If not we now need to retrieve the suggestions for the misspelled word and 
  append the previously stripped "." characters at the end.

I'm not to sure if the appending at the end is really necessary since I think in
the code for the UI there was some part that tried to deal with this problem (at
least if it is only one ".") But even if there is such code it should be alright
with the spellchecker adding the previously cut off "." characters. If not I
would consider it being a bug in that part of the code and you should just drop
me a note and I will see how it should/can be fixed.

Comment 7 thomas.lange 2006-01-19 10:31:51 UTC
Another side note: I think there also was an issue that the
replacement/suggestion for a word should keep the capitalization of the original
word. But I don't remember if it was for the thesaurus or the spellchecker.
Comment 8 lars 2006-04-09 10:37:09 UTC
*** Issue 64147 has been marked as a duplicate of this issue. ***
Comment 9 ftack 2010-08-18 12:58:25 UTC
This, along with issue 49895, are quite visible and significant issues on
spellchecking. Spellchecking that introduces other unexpected errors
(punctuation disappearing, case changing) is simply unreliable. Such issues
should not persist after being reported for more than seven years.
Comment 10 ooolist2007 2010-08-18 19:48:58 UTC
.
Comment 11 michael.ruess 2010-08-19 08:26:31 UTC
This issue still occurs in current builds.
Use the mentioned sample text in the first comment. There you will see, that
"Change all" in the spelling dialog will remove the periods following "herw".