11-14-2017, 02:15 PM | #16 |
Sigil Developer
Posts: 7,506
Karma: 5433350
Join Date: Nov 2009
Device: many
|
It would be interesting to see the QChar values of the smart right single quoted word when it reaches the spellcheck code on Windows. This must be either a Qt specific bug in Windows or an encoding issue at some point as it works on both Linux and Mac.
I will eye-ball the code to see if I can find a suspect. |
11-14-2017, 02:33 PM | #17 |
Sigil Developer
Posts: 7,506
Karma: 5433350
Join Date: Nov 2009
Device: many
|
I am betting the problem is here:
Code:
QString Utility::getSpellingSafeText(const QString &raw_text) { // There is currently a problem with Hunspell if we attempt to pass // words with smart apostrophes from the CodeView encoding. // There are likely better ways to solve this, but this one does // get the job done until someone can implement something better. QString text(raw_text); return text.replace(QString::fromUtf8("\u2019"), "'"); } u2019 in utf-8 is a 3 byte sequence: 0xE2 0x80 0x99 and so fromUtf8 routine should be passed that byte sequence or we load QChar with u2019 and then use toUtf8 to generate the input or better yet use the QChar directly. |
11-14-2017, 02:43 PM | #18 |
Grand Sorcerer
Posts: 27,463
Karma: 192992430
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Let me know if there's anything you need me to try compiling and/or testing on Windows.
|
11-14-2017, 02:46 PM | #19 |
Sigil Developer
Posts: 7,506
Karma: 5433350
Join Date: Nov 2009
Device: many
|
So a better way to write this might be:
return text.replace(QChar(0x2019),QChar(0x27)); DiapDealer, when you get a free moment, would you try that change in Misc/Utility.cpp in getSpellingSafeText and see if it makes any difference? Thanks |
11-14-2017, 03:11 PM | #20 |
Sigil Developer
Posts: 7,506
Karma: 5433350
Join Date: Nov 2009
Device: many
|
Do you want me to push that change? It may not help, but certainly should not hurt.
|
11-14-2017, 03:49 PM | #21 | |
Grand Sorcerer
Posts: 27,463
Karma: 192992430
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
It also fixes the similar problem of adding words with smart-apostrophes to a user word-list (only adding a straight apos char would work previously). Last edited by DiapDealer; 11-14-2017 at 03:57 PM. |
|
11-14-2017, 05:09 PM | #22 |
Sigil Developer
Posts: 7,506
Karma: 5433350
Join Date: Nov 2009
Device: many
|
Glad to hear it! I will push it later this evening once I am back at my developer box.
|
11-14-2017, 06:32 PM | #23 |
Sigil Developer
Posts: 7,506
Karma: 5433350
Join Date: Nov 2009
Device: many
|
Just pushed that fix to master.
|
11-15-2017, 12:50 PM | #24 |
Sigil Developer
Posts: 7,506
Karma: 5433350
Join Date: Nov 2009
Device: many
|
Also, I have just pushed support for spellchecking words with numbers as controlled by a Sigil preference setting. That small change actually forced changes in many files and a ui dialog.
Please note, if your particular dictionary does not have any words with digits in them in their wordlist, this feature will not be of much help. This feature should appear in the next release unless I messed something up. |
11-15-2017, 05:58 PM | #25 | ||
Grand Sorcerer
Posts: 27,463
Karma: 192992430
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
The only thing in the above mentioned situations that isn't covered (that I've noticed) is: Quote:
|
||
11-15-2017, 06:33 PM | #26 |
Sigil Developer
Posts: 7,506
Karma: 5433350
Join Date: Nov 2009
Device: many
|
Words that have an internal normal dash (hyphen) should be spell checked properly given how the code handles them. If not, something is funny.
|
11-15-2017, 07:16 PM | #27 |
Grand Sorcerer
Posts: 27,463
Karma: 192992430
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
My bad. You're right. Questionable words on either side of the hyphen will mark the hyphenated word as misspelled. I was just tripped up by the fact that B-17 doesn't show up as a misspelling. Neither does A-14 F-70 Z-29 or D-11, regardless of the new number preference setting. Shouldn't things like that be flagged as potential misspellings?
|
11-15-2017, 09:11 PM | #28 |
Sigil Developer
Posts: 7,506
Karma: 5433350
Join Date: Nov 2009
Device: many
|
The individual letters A, B, etc and the numbers after the hyphen are all valid standalone words so they are legal hyphenated. That said that Gbh-17 should show up as wrong since Gbh is not a valid word. This also depends of the wordchar list provided in the en_US.aff file (or whatever dictionary aff file you are using.
|
11-16-2017, 12:58 AM | #29 | |
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Fantastic. Can't wait for the next version.
Quote:
This wasn't necessarily about showing up as misspelled, it was about showing up in the list at all. For example: Code:
The Letter B, B-17 Bomber, and Room B9. When in reality, there is only 1 "B" + 1 "B-17" + 1 "B9". This becomes a serious issue when it happens to something common, like "A", or the Index/Footnote Example, where there can be hundreds of "A" + "n" + "ff" + "f" within the EPUB. It becomes impossible to use the Spellcheck List to locate/find and correct these. Or in the case of "l92l". That shows up at 2 "l". Good luck searching through every lowercase 'l' in the book trying to find it! Last edited by Tex2002ans; 11-16-2017 at 01:01 AM. |
|
11-16-2017, 10:34 AM | #30 | |
Grand Sorcerer
Posts: 5,582
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
In the latest pre-release version, "l92l" will be marked as misspelled, if the new Check Numbers option is enabled. This should make it easier to find numbers with letters in them and vice versa, because all words that contain numbers and letters will be flagged as misspelled, if the new Check Numbers option is enabled. |
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Spellcheck in book view + selected text spellcheck | unfairrobot | Sigil | 2 | 12-19-2016 04:50 PM |
Suggestion: Spell Check Tool Enhancement | Tex2002ans | Editor | 35 | 07-11-2014 07:02 AM |
Enhancement suggestion - "Range" for series | HarryT | Calibre | 5 | 05-19-2012 03:58 PM |
SPELLCHECK NATION: Does SpellCheck have a dark side? | cbaehr | Self-Promotions by Authors and Publishers | 10 | 11-07-2010 12:45 PM |
Enhancement suggestion. | moggie | Calibre | 1 | 01-01-2009 01:35 PM |