Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 11-29-2015, 02:46 PM   #1
CalibUser
Addict
CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.
 
Posts: 201
Karma: 62362
Join Date: Jul 2015
Device: Sony
Using Hunspell dictionaries

I am trying to use the Hunspell dictionary that comes with Sigil to detect hyphenated words that are not always hyphenated.

For example, good-bye, is normally hyphenated but failed-and is not normally hyphenated unless it appears in a phrase such as he failed-and failed dismally.

However, the Hunspell dictionary passes both of these examples as correct. Is there a way to enable the Huunspell dictionary to identify good-bye as normally hyphenated and failed-and as not normally hyphenated?

I need to be able to distinguish between these types of hyphenated words so that I can write code for my plugin at https://www.mobileread.com/forums/sho...d.php?t=264378 to change the short hyphen to a long hyphen where appropriate. For example, I want to change the short hyphen in:

he failed-and failed dismally to a long hyphen (mdash) in:

he failed–and failed dismally.
CalibUser is offline   Reply With Quote
Old 11-29-2015, 04:13 PM   #2
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,651
Karma: 5433388
Join Date: Nov 2009
Device: many
AFAIK, no. There is no real way to separate "good-bye" and "failed-and" as being different in the eyes of the spell-checker. You could of course build a wordlist of commonly hyphenated words and check it to see if it makes this common list, but I really can't say that one of those is incorrectly spelled and therefore a mistake in spelling.

Sorry
KevinH is offline   Reply With Quote
Old 11-29-2015, 04:25 PM   #3
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
"good-bye" is an actual word. "failed-and" is two words improperly hyphenated.

But spellcheckers don't really seem to consider that one word, for some reason. I guess they think all dashes are the same -- hyphens, en dashes, em dashes, what's the big deal? So I'm not really sure what Sigil is supposed to do about that.
You'll see the same problem in calibre, or for that matter the Firefox/Chrome edit box.

Last edited by eschwartz; 11-29-2015 at 04:28 PM.
eschwartz is offline   Reply With Quote
Old 11-29-2015, 04:36 PM   #4
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,580
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
@CalibUser - This is what I do - in Spellcheck; check the Show all words box at the bottom of the list, then enter a hyphen into the Filter box at the top of the list. Eyeball the list looking for anomalous entries. such as failed-and.

I also have a saved search to find non-breaking hyphens, which maybe useful in 'identifiers', such as telephone or part numbers etc, but, IMO at least, they're best avoided elsewhere.

BR
BetterRed is offline   Reply With Quote
Old 11-30-2015, 01:58 PM   #5
CalibUser
Addict
CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.CalibUser goes to eleven.
 
Posts: 201
Karma: 62362
Join Date: Jul 2015
Device: Sony
Thank you for all your replies.

Interesting that spellcheckers don't really seem to consider "failed-and" as a hyphenated word.

As I needed my plugin to replace short hyphens by long hyphens for these types of words, I will follow the suggestion made by KevinH and use the method used by BetterRed to compile a list of words that need to have the long-hyphen changed.
CalibUser is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
dictionaries shleepy Bookeen 29 12-14-2013 11:15 AM
Other Non-Fiction Lin, Roger: hunspell le glouton. V1. FRENCH. 02 FEB 2013 roger64 Other Books 0 02-02-2013 06:49 AM
Batch process of words for the hunspell user dictionnary roger64 Sigil 3 01-26-2013 07:32 AM
Dictionaries under 2.1.0. jshzh PocketBook 11 01-13-2012 04:53 AM
About dictionaries ddaneel Bookeen 8 07-12-2008 11:07 AM


All times are GMT -4. The time now is 11:20 PM.


MobileRead.com is a privately owned, operated and funded community.