Bug 161637 - spell checking: don’t suggest straight (ASCII or typewriter) apostrophe instead of the correct typographic version
Summary: spell checking: don’t suggest straight (ASCII or typewriter) apostrophe inste...
Status: RESOLVED FIXED
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: target:25.2.0 target:24.8.0.0.beta2
Keywords:
Depends on:
Blocks: Authors
  Show dependency treegraph
 
Reported: 2024-06-18 12:40 UTC by László Németh
Modified: 2024-06-21 10:49 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description László Németh 2024-06-18 12:40:53 UTC
Description:
Despite the default typographic apostrophe, spell checking still suggests the obsolete ASCII version.

Steps to Reproduce:
1. type "cannt" in an English language document, and check spelling.

Actual Results:
Suggested the correct form with incorrect character:

can't

Expected Results:
Suggesting typographic apostrophe:

can’t


Reproducible: Always


User Profile Reset: No

Additional Info:
See https://en.wikipedia.org/wiki/Apostrophe#Typographic_form
Comment 1 V Stuart Foote 2024-06-18 13:09:29 UTC
@László, OK but is there some ICU lib transliteration in i18n for handling of the U+0027 as U+2019 in the "suggested" correction?

Otherwise, the swap of U+2019 for U+0027 (as keyboard input) when spell-checked seems like it should follow the Autocorrect 'Localized Options' tab (by CLDR) for Single Quotes 'Start quote' and 'End quote' and be an autocorrection after the spellcheck is applied.

Just asking...
Comment 2 Commit Notification 2024-06-18 15:27:31 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/ee6bf912d615d0afa438f743ddf3e4f6f5f890aa

tdf#161637 linguistic: fix apostrophe in spelling suggestions

It will be available in 25.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 3 László Németh 2024-06-18 16:10:52 UTC
(In reply to V Stuart Foote from comment #1)
> @László, OK but is there some ICU lib transliteration in i18n for handling
> of the U+0027 as U+2019 in the "suggested" correction?
> 
> Otherwise, the swap of U+2019 for U+0027 (as keyboard input) when
> spell-checked seems like it should follow the Autocorrect 'Localized
> Options' tab (by CLDR) for Single Quotes 'Start quote' and 'End quote' and
> be an autocorrection after the spellcheck is applied.
> 
> Just asking...

Good question. Word processors support professional appearance more and more, see the new default font Aptos of MS Office with real optical sizes. Typewriter-style apostrophes dropped from document editing likely 20 years ago. I have enabled it, as default setting in LibreOffice 9 years ago.
Using typewriter apostrophe does not comply with typographic and orthographic rules.

A clear problem for Writer, that (likely most of) the users add their words with typographic apostrophe to the user dictionary, but they will get suggestions with typewriter apostrophe.

Also the (already) UTF-8 English dictionary added apostrophe conversion for the input (instead of fixing the apostrophe in the dictionary), but forgot to convert the output:

~/libreoffice/dictionaries$ grep '[IO]CONV' en/en_US.aff 
ICONV 1
ICONV ’ '

Also for non-UTF-8 Hunspell dictionaries, the conversion is really i18npool or ICU-level, but also without restoring the lost typographic apostrophe.

Also the (e.g. English) AutoCorrect rules use typographic apostrophe. For example, typing "shouldnt" is immediately replaced by "shouldn’t".

I suspect that anyone who doesn't know the difference won't be bothered by the correct apostrophe, but I'm sure there will be far fewer dissatisfied users than there are now. But you are right, we need more flexibility to support all the users. I plan to fix Bug 138258/Bug 149630 (search for apostrophe and single quote), which is very annoying for several users, and related to this problem, too.
Comment 4 Commit Notification 2024-06-21 10:49:43 UTC
László Németh committed a patch related to this issue.
It has been pushed to "libreoffice-24-8":

https://git.libreoffice.org/core/commit/01c6b99f5836d36f4b8d11320b8ae62ccda814b2

tdf#161637 linguistic: fix apostrophe in spelling suggestions

It will be available in 24.8.0.0.beta2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.