Bug 91151 - Spellcheck: "Correct All" does not correct all occurrences of misspelling throughout the document
Summary: Spellcheck: "Correct All" does not correct all occurrences of misspelling thr...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Linguistic (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 92545 126814 143231 161245 (view as bug list)
Depends on:
Blocks: Spell-Checking
  Show dependency treegraph
 
Reported: 2015-05-07 23:55 UTC by Anaya Patos
Modified: 2025-07-04 03:13 UTC (History)
11 users (show)

See Also:
Crash report or crash signature:


Attachments
91151_correctAll.odt: example document (8.70 KB, application/vnd.oasis.opendocument.text)
2025-07-03 14:13 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anaya Patos 2015-05-07 23:55:50 UTC
There is a failure during spell checking, telling to “Change All”, not performs the function of correcting the Following words
forgiveness by Google translation


Versión: 4.4.3.2
Id. de compilación: 88805f81e9fe61362df02b9941de8e38a9b5fd16
Configuración regional: es_ES
Comment 1 Buovjaga 2015-05-15 09:52:04 UTC
Could not reproduce.
Correct all changes all the instances of an erroneous word.

Ubuntu 15.04 64-bit 
Version: 4.4.2.2
Build ID: 40m0(Build:2)
Locale: en_US

Version: 5.0.0.0.alpha1+
Build ID: 4c665178f49952138835fd318edef8978ac806e3
TinderBox: Linux-rpm_deb-x86_64@46-TDF-dbg, Branch:master, Time: 2015-05-12_06:15:42
Locale: en-US (en_US.UTF-8)
Comment 2 Gordo 2015-05-20 19:36:40 UTC Comment hidden (obsolete)
Comment 3 Stéphane Guillou (stragu) 2024-06-11 03:22:20 UTC
Bug 46852 was about a different issue: using "Correct All" in combination with "Continue checking at beginning of document", the spellcheck process concluding prematurely. That was indeed fixed in LO 6.0.

The issue described by Anaya is different: pressing "Correct all" does not correct all the same misspellings throughout the document (or at least, from the active word to the end of the document). And this is still the case in a recent daily build, as well as in OOo 3.3.

Bug 75922 alludes to this, but was tracking many different issues with Correct All, so better keep that one as "resolved - works for me".

This bug here can be reproduce with the default English dictionaries, and the following steps:

1. In a new Writer document, with document in any English variant, paste the following paragraphs (unformatted):

dogg
dogg
catt dogg
frogg frogg
frogg catt dogg
dogg catt
frogg, dogg, catt

2. With cursor at beginning of document, start Tools > Spelling (F7)
3. Click "Correct All" for the suggestion "dogg -> dog"

Result A: first two paragraphs are corrected, not the rest.

4. Click "Close"

Result B: third paragraph is corrected, but not the rest.

Expected result: all occurrences of "dogg" are replaced by "dog" throughout the document as soon as "Correct All" is pressed. This is the expectation according to the documentation[1]:

"Replaces all occurrences of the unknown word with the current suggestion."

I haven't seen any evidence that the command shouldn't apply to the whole document, and the feature should at least behave on par with the "Ignore All" command, which ignores all occurrences instantly and removes the red underline, before and after the current position.

Version: 24.8.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 5a75414d1772d1fd998f405e3b9bd80b1f10c51f
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: CL threaded

Same results in OOo 3.3.

Similar issue in Impress, see e.g. bugdoc[2] from AOO tracker[3].

[1]: https://help.libreoffice.org/24.8/en-US/text/shared/01/06010000.html
[2]: https://bz.apache.org/ooo/attachment.cgi?id=68817
[3]: https://bz.apache.org/ooo/show_bug.cgi?id=110688
Comment 4 Stéphane Guillou (stragu) 2024-06-11 03:24:33 UTC
*** Bug 92545 has been marked as a duplicate of this bug. ***
Comment 5 Stéphane Guillou (stragu) 2024-06-11 03:24:51 UTC
*** Bug 126814 has been marked as a duplicate of this bug. ***
Comment 6 Stéphane Guillou (stragu) 2024-06-11 03:26:04 UTC
*** Bug 143231 has been marked as a duplicate of this bug. ***
Comment 7 Stéphane Guillou (stragu) 2024-06-11 03:26:26 UTC
*** Bug 161245 has been marked as a duplicate of this bug. ***
Comment 8 larrybradley 2024-07-30 02:07:56 UTC Comment hidden (no-value)
Comment 9 Paul 2024-11-15 17:52:57 UTC
(In reply to Stéphane Guillou (stragu) from comment #4)
> *** Bug 92545 has been marked as a duplicate of this bug. ***

That was an excellent breakdown of the problem, thank you. I have been experiencing it for years and finally decided to inquire about it.

Continuing on, using your example, I see that if I continue with the spellcheck operation, the "correct all" for "dogg" does work as I advance to the following paragraphs.

So whereas my expected behavior is that clicking "correct all" immediately corrects all instances of the mistake, instead LO requires continuing the spellcheck through the ensuing data. Thus, "correct all" is not an automatic process, it is semi-automatic.

Making the Correct All function automatic for the whole document would be much better and more in line with what people expect of the function, in my opinion.

I'm on LO 25.2.0.0 on Linux Deb.
Comment 10 Paul 2025-01-17 14:15:22 UTC
I've since discovered that the length of the document has a lot to do with how spellcheck / correct all works. 


For shorter documents, it does work. If you paste this into a new Writer document:

misspellingxxx misspellingxxx misspellingxxx misspellingxxx misspellingxxx misspellingxxx misspellingxxx misspellingxxx misspellingxxx misspellingxxx misspellingxxx misspellingxxx misspellingxxx misspellingxxx misspellingxxx

and do a "correct all", the whole paragraph is immediately corrected. Perfect.

But if that paragraph is at the end of a long document, and you "correct all" one instance of "misspellingxxx" at the doc beginning, nothing happens to the last paragraph.

It gets worse. As you progress with spellcheck, other instances of "misspellingxxx" along the way will not have been changed. You will have to manually correct each of them. So letting spellcheck advance to the end of the document (which may be impractical in one sitting with a large document with many spelling corrections) will still not make all the Correct All changes.
Comment 11 Shantanu 2025-01-20 04:43:09 UTC
@Paul, I believe your assessment is incorrect. The length of the document is not a contributing factor to the issue. For example, consider the following case:

misspellingxxx misspellingxxx admet misspellingxxx misspellingxxx misspellingxxx misspellingxxx misspellingxxx misspellingxxx misspellingxxx misspellingxxx misspellingxxx misspellingxxx misspellingxxx misspellingxxx misspellingxxx

If you click "Close" immediately after the first "Correct All", the result will be:

misspelling misspelling admet misspellingxxx misspellingxxx misspellingxxx misspellingxxx misspellingxxx misspellingxxx misspellingxxx misspellingxxx misspellingxxx misspellingxxx misspellingxxx misspellingxxx misspellingxxx

Only the first two words are corrected, while the remaining errors after "admet" remain unchanged. 

misspelling misspelling admit misspelling misspelling misspelling misspelling misspelling misspelling misspelling misspelling misspelling misspelling misspelling misspelling misspelling

If you require the correct output (mentioned above), you must also correct the word "admet." Exiting the spelling dialogue box prematurely is not an option, and this behavior constitutes a bug.
Comment 12 Paul 2025-01-20 04:52:24 UTC
Shantanu, the behavior you describe is correct.

At this point I'm not sure what's going on. Previously, the paragraph:


Misspellingxxx misspellingxxx misspellingxxx misspellingxxx misspellingxxx
misspellingxxx misspellingxxx misspellingxxx misspellingxxx misspellingxxx
misspellingxxx

in a new document containing only it, was completely corrected with the first and only Correct All. Now I have to do two Correct All's, and then the entire paragraph is corrected. I can't explain the difference. I'm on 25.8.0.0 at the moment.

At any rate, there is a bug of some sort, and it makes the spellcheck useless on long documents with many spelling errors.
Comment 13 Shantanu 2025-01-20 05:42:19 UTC
The spell check functions as expected as long as the "Close" button is not clicked prematurely. It has been used by millions of people for decades. 
To prevent the bug from occurring, ensure that all words are checked using options such as "Ignore", "Correct All" etc, and wait for the notification stating, "The spellcheck is complete."
Comment 14 birnbach@posteo.de 2025-01-20 12:04:20 UTC Comment hidden (no-value)
Comment 15 Paul 2025-01-20 12:20:48 UTC
I cannot confirm that either. I have done Correct All's, proceeded to other corrections, and then come upon further instances of words I had Correct All'd, all in one uninterrupted spellcheck session. That is why I finally pretty much gave up on trying to work with LO's spellcheck. I thought that document size might have something to do with it.

I can see a spellcheck through to completion on a smaller document, but take one that's 400 pages, with British spellings, archaic spellings, and OCR errors that all need to be corrected, then being forced to ride the spellcheck through to the end for all the Correct All's to be effected becomes unworkable, in my view.
Comment 16 Shantanu 2025-01-21 04:57:38 UTC
@birnbach, You've encountered yet another bug: "Correct All ignores the final word."
Bug 92545

@Paul, you're absolutely right about "being forced to ride the spellcheck through to the end for all." But that's just the way it is — for now — until some kind soul takes pity on us and finally fixes this.
Comment 17 Justin L 2025-07-03 14:13:02 UTC
Created attachment 201641 [details]
91151_correctAll.odt: example document

I started testing this bug using the Find/Replace dialog. In that case it worked fine - in both OOo 3.3 and LO 26.2.

But this bug report is about the SPELL CHECKER, not find/replace. As reported by various commenters, it seems to auto-correct the words until it reaches the next misspelled word - which at first glance is very unexpected.

HOWEVER, as I continued to correct-all "catt", it then also auto-corrected the next dogg, and when I continued to correct-all "frogg", it then auto-corrected the remaining catts and doggs too. [Already worked like this in OOo 3.3.]

(Also note that in the preview line for correcting "catt" that dog has already been shown as corrected.)

In other words, it is only when you stop the spell-check half-way through that the correct-all doesn't occur. (Or if you make changes to the document itself - bypassing the spell-check dialog.)

And from a technical perspective, that makes a lot of sense. When you make corrections to words, you are changing the number of characters in a paragraph, so stepping through it in a linear fashion allows the spell-checking-process to only read the document once, instead of re-reading the entire thing after every correction. It is a huge accuracy and performance concern.

So I'm not really sure there actually is a bug here.

Some possibilities for improvements:
-continue the correct-all process for the remainder of the document when the close button is pressed (although that feels somewhat dangerous).
-keep the correct-all list active even though the user has made changes to the document itself (although I expect that at the implementation level "resume" has started the spell-check all over again - starting at the cursor position).
Comment 18 Justin L 2025-07-03 14:50:21 UTC
Ah, Shantanu already described what I "discovered". 

(In reply to Paul from comment #12)
> Misspellingxxx misspellingxxx ...
> 
> Now I have to do two Correct All's, and then the entire paragraph is corrected.
> I can't explain the difference.
One word is capitalized, the other is not. They need to be corrected separately.
Comment 19 Paul 2025-07-03 15:30:01 UTC
Thank you, Justin. The capitalization difference does make sense and needs to be respected.

But as far as changing all identical misspells at the same time, google docs, the only alternative I currently have access to, does so, instantly, without the user parsing through the document, at least for a one-page document. And I think that's the expected way Correct All should work.
Comment 20 larrybradley 2025-07-03 17:49:05 UTC
(In reply to Justin L from comment #17)
> Created attachment 201641 [details]
> 91151_correctAll.odt: example document
> 
> I started testing this bug using the Find/Replace dialog. In that case it
> worked fine - in both OOo 3.3 and LO 26.2.
> 
> But this bug report is about the SPELL CHECKER, not find/replace. As
> reported by various commenters, it seems to auto-correct the words until it
> reaches the next misspelled word - which at first glance is very unexpected.
> 
> HOWEVER, as I continued to correct-all "catt", it then also auto-corrected
> the next dogg, and when I continued to correct-all "frogg", it then
> auto-corrected the remaining catts and doggs too. [Already worked like this
> in OOo 3.3.]
> 
> (Also note that in the preview line for correcting "catt" that dog has
> already been shown as corrected.)
> 
> In other words, it is only when you stop the spell-check half-way through
> that the correct-all doesn't occur. (Or if you make changes to the document
> itself - bypassing the spell-check dialog.)
> 
> And from a technical perspective, that makes a lot of sense. When you make
> corrections to words, you are changing the number of characters in a
> paragraph, so stepping through it in a linear fashion allows the
> spell-checking-process to only read the document once, instead of re-reading
> the entire thing after every correction. It is a huge accuracy and
> performance concern.
> 
> So I'm not really sure there actually is a bug here.
> 
> Some possibilities for improvements:
> -continue the correct-all process for the remainder of the document when the
> close button is pressed (although that feels somewhat dangerous).
> -keep the correct-all list active even though the user has made changes to
> the document itself (although I expect that at the implementation level
> "resume" has started the spell-check all over again - starting at the cursor
> position).

I have continued to have this problem over the course of the years, even now. After many, many more occurrences, my best analysis is this: First, the problem is dependent on the size of the document and the number of misspellings in the document. Second, the easiest solution would be to have the program always offer to "turn off the undo" function whenever the user clicks on "Spelling." Third, it would be nice to have a "progress bar" that resides at the bottom of the screen so that the user does not become frustrated and stop the spellcheck before it has had a chance to work its way to the end of the document. Thank you all so much for your time and attention to this matter.
Comment 21 Justin L 2025-07-03 18:25:34 UTC
Useful information:
bug 132505: "Ignore all" affects all open documents for an entire session by adding the word to Tools - Options - Languages and Locals - Writing Aids - List of Ignored Words

That's very different from the "Correct All" list which seems to be so easily lost. (However, I am NOT advocating that CorrectAll act the same as IgnoreAll - it definitely should NOT affect an entire session, and probably not even subsequent runs of the spell-check. However, it SHOULD remain active the entire time the spell-check dialog is active.) See duplicate bug 126814 which has steps to reproduce an unexpected "resume" situation that has lost the CorrectAll list.