Mobileread
Spellcheck dialog shows well-spelled words as misspelled
#1  ebray187 03-02-2021, 08:22 PM
In code view, word underlining works fine by adding it to misspelled words only. However, the spell check dialog also shows well-written words.
I do not know if I am configuring or using something wrong or if it is an problem with Sigil or my current epub. I had understood that adding the xml:lang="X" was enough for it to work properly.

image »

In the screenshot "informadas" is well-written. Is a test with only 2 words, but i'm working on a large book with a looooot of false positives, so the Spellchecker dialogue is almost unusable for me.

I stay tuned to provide more information if necessary.

Regards.

-----------------------------------
Sigil 1.4.3
QT 5.15.2
Gentoo Linux
Reply 

#2  ebray187 03-02-2021, 08:34 PM
Also i have set the <dc:language>es</dc:language> into the content.opf file
Reply 

#3  KevinH 03-02-2021, 08:38 PM
In Sigil's Preferences, what has you set for the default language, and what for the Primary and Secondary Dictionaries?

Do you have a proper hunspell spanish dictionary installed?
Reply 

#4  ebray187 03-02-2021, 08:52 PM
User Interface Language: English
Default Language For Metadata: Spanish

On the primary language dictionary i have a custom spanish dictionary (aff and dic files inside the hunspell_dictionaries folder). I used this dictionary without problems since 0.6, 0.9.4, 1.2.1 and 1.3.0

Nothing on the second language.
Reply 

#5  ebray187 03-02-2021, 09:01 PM
Here is a zip with the epub and the dictionary
Reply 

#6  KevinH 03-02-2021, 09:06 PM
Does your custom dictionary follow the hunspell language naming convention:

es_ES.dic
es_ES.aff

Exactly how are the .aff and .dic files you are using are named? The spellcheck dialog does not use the Primary Dictionary per se. It instead depends on the normal naming convention to map language codes into dictionary names automatically.

My guess is your custom dictionary is not being mapped to es because of its differs from the naming convention.
Reply 

#7  KevinH 03-02-2021, 09:12 PM
Yep, how on earth is the SpellCheck Dialog which can now handle any number of languages and dictionaries supposed to know your .dic and .aff are for spanish given no language code at the start of the file names.

Rename them to match the expected convention - or use two symlinks using new names that match convention if you do not want to rename and restart Sigil and all should work.
Reply 

#8  ebray187 03-02-2021, 09:25 PM
Got it. Thanks!!

From a user point of view I think it would be useful to be able to specify which dictionary to use for X language by following the convention of the xml:lang (for "en", use this; for "es" this). In the current state it can be a bit misleading that the primary language dictionary setting is not what applies to the spellcheck language.

Anyway thanks a lot for your help and for all the work making this amazing tool.
Reply 

#9  KevinH 03-02-2021, 10:27 PM
On Windows and macOS, we supply the Hunspell dictionaries along with Sigil. So they of course follow the start with language code naming convention.

Even MySpell, the predecessor to HunSpell, and ispell the predecessor to MySpell, all follow that naming convention of starting with a language code.

So there is a long long history on unix/linux for naming dictionaries so no one has to guess what language they are for especially as these dictionaries are shared across many apps.

That is why there really is no need to have to associate language codes with dictionaries. It would just make them harder to use and share with repeated mappings needed for multiple apps.

Sorry but Sigil will not be changing how we handle this.

Glad to hear you got it working!
Reply 

#10  Tex2002ans 03-03-2021, 04:27 AM
Quote ebray187
Also i have set the <dc:language>es</dc:language> into the content.opf file


An EPUB's language goes like a pyramid:

1. Setting the content.opf correctly is the most important! And you did that great.

This says "this book is in Spanish!"

2. (Optional) Add lang + xml:lang to your <html>:

Chapter01.xhtml (Before):

Code
<html xmlns="http://www.w3.org/1999/xhtml">
Chapter01.xhtml (After):

Code
<html xmlns="http://www.w3.org/1999/xhtml" lang="es" xml:lang="es">
This says "this chapter is Spanish!"

3. (Super duper optional) Mark "foreign words" with their language:

Code
<p>¿Puedo ir al bathroom, por favor?</p>
Code
<p>¿Puedo ir al <span lang="en" xml:lang="en">bathroom</span>, por favor?</p>
This says "the entire book/chapter/sentence is in Spanish, but the word 'bathroom' is English!"

Quote ebray187
I had understood that adding the xml:lang="X" was enough for it to work properly.
Any time you're marking which language, it's good practice to use BOTH lang + xml:lang.

Basic idea is lang = HTML + xml:lang = XML.

I explained a little more in this post a few days ago:

"Search and Replace" (Post #11)

And one common error that occurs is someone having the book + chapters be mismatched.

(So a Spanish book "es", but you accidentally set English "en" in an HTML chapter. This is pretty easy to spot in the Language column in Tools > Spellcheck > Spellcheck.)
Reply 

  Next »  Last »  (1/2)
Today's Posts | Search this Thread | Login | Register