Contractions not recognized by spelling checker when real apostrophe character used

RESOLVED FIXED in mozilla1.8.1beta1

Status

()

Core
Spelling checker
P1
normal
RESOLVED FIXED
14 years ago
12 years ago

People

(Reporter: Greg K., Assigned: Brett Wilson)

Tracking

({fixed1.8.1, testcase})

1.8 Branch
mozilla1.8.1beta1
fixed1.8.1, testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

14 years ago
When using a +ve contraction (e.g., we've) and a real apostrophe character
(U+2019) instead of a foot mark (U+0027), the spelling checker fails to
recognize the contraction. All other contractions (+s, +ll, +t, +re, +m and +d)
are apparently recognized when using either symbol.

To reproduce:
Create a new e-mail message and type in "we've we’ve" (using the real apostrophe
in the second word)
2. Check spelling

Actual results:
Spelling checker flags the second instance of "ve" as a word by itself

Expected results:
Spelling checker should show no misspellings.
(Reporter)

Comment 1

14 years ago
Created attachment 143781 [details]
HTML testcase that can be opened in editor and spell-checked to demonstrate the bug
(Reporter)

Updated

14 years ago
Keywords: testcase

Comment 2

14 years ago
this appears to be a dup of 218463, but I don't have permissions to change it's
status...
This is about catching misspellings, the other is about suggestions.

Comment 4

14 years ago
This appears to be because s, ll, t, re, m and d all pass spell-checking as
individual words. "we値l" is checked as two separate words.

Comment 5

13 years ago
Created attachment 171546 [details] [diff] [review]
Proposed patch (partial - changes dictionary but only adds "we’ve" as a demonstration)

This has two parts. The change to mozEnglishWordUtils.cpp ensures that a U2019
apostophe is included as part of a word. But changing this on its own means
that the part of the word after the apostrophe is never spell-checked, because
the text is transformed into ISO8859-1 and the apostrophe is an illegal
character. So either Unicode apostrophes would need to be replaced with ASCII
apostrophes in a copy of the source text, or, as here, I changed the character
set to CP1252 so that the apostrophe character can be represented. This would
need the dictionaries to be updated, the patch includes only "we’ve" as a
demonstration. If this approach is approved then I could go through the
dictionary in full.

Updated

13 years ago
Attachment #171546 - Flags: review?(mscott)
Instead of changing myspell, i'd rather change ’ to ' before calling myspell.
Then you don't have to maintain your own version of the dictionary and don't
have to have two copies of one word in the dict.

Comment 7

13 years ago
Comment on attachment 171546 [details] [diff] [review]
Proposed patch (partial - changes dictionary but only adds "we’ve" as a demonstration)

OK, withdrawing review request.
Attachment #171546 - Flags: review?(mscott)

Comment 8

13 years ago
> Instead of changing myspell, i'd rather change ’ to ' before calling myspell.
> Then you don't have to maintain your own version of the dictionary and don't
> have to have two copies of one word in the dict.

On the other hand, if we change the dictionaries, then we can internationalise
the change easily. Changing ` to ' in the code may be too Anglocentric.
(Assignee)

Comment 9

12 years ago
This is already fixed in a patch I'm working on for one of the other spellcheck bugs (which one I'm not sure because it fixes many).
Assignee: nobody → brettw
Blocks: 338999
OS: Mac OS X 10.2 → All
Priority: -- → P1
Hardware: Macintosh → All
Target Milestone: --- → mozilla1.8.1beta1
Version: Trunk → 1.8 Branch
(Assignee)

Updated

12 years ago
Summary: +ve contractions not recognized by spelling checker when real apostrophe character used → Contractions not recognized by spelling checker when real apostrophe character used
Brett, does your patch also fix issues with other "typographic" symbols, or should I file another bug on that?  

E.g., using a real em-dash (U+2014) without spaces flags the entire word-em-dash-word as one misspelled word where using the equivalent -- does not.

Bob--the fastest man in the universe--still lost the race.  <--fine
Bob—the fastest man in the universe—still lost the race.  <-- flags

Both this and Greg's original issue are all the more glaring on Mac OS X, where the system spellchecker correctly treats (U+2019) and (U+0027) as identical and treats -- and (U+2014) as identical; it joins elements separated by the former pair and splits elements separated by the latter when spell-checking. :(
(Assignee)

Comment 11

12 years ago
This was fixed by bug 339478.
Status: NEW → RESOLVED
Last Resolved: 12 years ago
Keywords: fixed1.8.1
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.