04-19-2014, 07:26 AM | #1 |
Junior Member
Posts: 9
Karma: 10
Join Date: Apr 2014
Device: samsung galaxy tab 10.1
|
Multiple English Spelling Dictionaries
Hi
The new spelling check facility is great - thanks to Kovid. Does anyone know if there a way of enabling 2 English dictionaries simultaneously so eg US and British English are let through the check? Sorry if I have missed an obvious answer. Thanks for any replies |
04-19-2014, 05:04 PM | #2 |
null operator (he/him)
Posts: 20,567
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
I don't think there's any easy way.
See also https://www.mobileread.com/forums/sho...8&postcount=37 Maybe mrmikel has found a combined dictionary - but then again, if he had then I'm sure he would have posted something. BR |
Advert | |
|
04-19-2014, 05:19 PM | #3 |
Color me gone
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
|
nope. I saw something that suggested combining them, but I don't understand the structure. Nor did I see any program to do so, but that seems like it might be something that someone could do.
http://code.google.com/p/hunspell-merge/downloads/list is a merge utility for hunspell. Looks like a java setup, but I don't know just how they relate one to the other, otx vs hunspell. Here is website for roll your own.: http://www.suares.com/index.php?page_id=25&news_id=233 Last edited by mrmikel; 04-19-2014 at 05:29 PM. |
04-20-2014, 12:10 AM | #4 | |
null operator (he/him)
Posts: 20,567
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
If you copy the .otx and rename to zip, then you can unarchive to a folder and it will have the .dic(tionary) and .aff(ix) files, which is what calibre and sigil use. The java program seems to merge the diff and aff files that Sigil ships OK, and for Sigil you only need to put the merge dictionaries into its hunspell_dictionaries folder and then select the merged name in its preferences for spell checking. I have attached a zip with the four merged files. I have done very limited testing. The dictionary name is en_gb_us. As always, if it eats your book... Caveat Emptor. The program is a bit fiddly in windows, I had to play around a bit to get the 'hang of it' - basically you need to get the .dic files and corresponding .aff files that you want to merge into the one folder, select the two or more .dic files in its list and hit the merge button. Calibre requires OXT files. I didn't work out how to merge the other files (8 of them) that are packaged into an OXT file - nor will I be doing so. Added - The attachment cannot be used in the Calibre Book Editor - it can be used by Sigil, more investigation/work is required to create a combined OXT file, which is what calibre needs. BR Last edited by BetterRed; 04-20-2014 at 07:02 PM. |
|
04-20-2014, 06:22 AM | #5 |
Color me gone
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
|
Thanks, will test it out.
|
Advert | |
|
04-20-2014, 06:55 PM | #6 | |
null operator (he/him)
Posts: 20,567
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
In another thread mrmikel posted this https://www.mobileread.com/forums/sho...5&postcount=53
Quote:
I had hoped my previous post made it clear that it can't be used with Calibre. I've added a paragraph to make it clear. They can't be used by calibre as it requires an OXT file. Whilst an OXT is a rebadged ZIP, it contains files in addition to the .dic(tionary) and .aff(ix) files as in Code:
META-INF manifest.xml *en_US.aff th_en_US_v2.dat *en_US.dic *hyph_en_US.dic th_en_US_v2.idx license.txt affDescription.txt changelog.txt dictionaries.xcu description.xml I find it odd that this issue (combining dictionaries) has arisen in the context of the calibre book editor, with a quick search I couldn't find anything similar in the Sigil forum BR Last edited by BetterRed; 04-20-2014 at 07:14 PM. |
|
04-20-2014, 11:30 PM | #7 |
creator of calibre
Posts: 43,856
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
@BR: All calibre needs in an oxt file if the .aff and .dic files and the .xcu file that specifies the metadata (which you should be able to just copy from another oxt and alter slightly).
|
04-21-2014, 12:23 AM | #8 | |
null operator (he/him)
Posts: 20,567
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
I'll have a closer look when I get home this evening BR |
|
04-21-2014, 07:08 AM | #9 |
null operator (he/him)
Posts: 20,567
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
I've created an oxt with GB and US spellings that seems to work - tested on calibre portable with words like labour/labor, realise/realize, saviour/savoir.
You'll need to rename the attached zip to oxt. I used the GB & US dictionaries from Sigil as the 'baseline', which I think are the same as those shipped with calibre. And I followed Kovids guidance to create a 'merged' dictionaries.xcu file - I have no idea whether I've done it the best or even the right way. I installed it with the preferred variant set to United Kingdom. After installing it you have to set en_gb_us as the preferred dictionary. The calibre dictionaries have a file called locale - I couldn't figure out how to get a sensible set of values for it out of the oxt. But its just a list of country codes so I created it by hand after I installed the oxt (see below). I combined what calibre puts in the shipped GB and US locale files. Note the absence of locales such as en-AU, en-SG, en-HK, en-ZA etc. But it seems to work in AU and I would assume elsewhere too. I think these are the language 'variants', I'm not entirely sure as to their raison d'être, maybe they're something to do with language tags in the xhtml Code:
en-GB en-BS en-BZ en-GH en-IE en-IN en-JM en-NZ en-TT en-US en-PH I don't want support this 'thing', I regard it as something less than a proof of concept prototype. I took an interest in mrmikels query as to the availability of a combined US/UK dictionary only because I was recently delving into Sigils dictionaries regarding a problem I was having with apostrophes in its spell checker. I personally have no use for a combined dictionary. It would probably be better if such a dictionary came from one of the Open Office variants. I'm not interested in getting involved with that either, I think the version of OOo I have (not installed) is circa 2005. That said I'll try answer any questions and pass on knowledge about how I 'constructed' the oxt, the hard-yards were done by the java proggie that mrmikel found BR Last edited by BetterRed; 04-21-2014 at 08:29 AM. |
04-21-2014, 07:50 AM | #10 |
US Navy, Retired
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
|
04-21-2014, 08:27 AM | #11 |
null operator (he/him)
Posts: 20,567
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
|
04-21-2014, 10:13 AM | #12 |
Color me gone
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
|
He's so attached to it he couldn't bear to part with it!
|
04-21-2014, 10:24 AM | #13 |
Color me gone
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
|
BR, understood that this experiment is making your feel like Dr. Frankenstein.
It doesn't quite work because it attaches to the US dictionary but does not add to it. Like you, I don't want to thrown out the US dictionary to find out. I think it needs to be a private dictionary. But this is all too much work for idle curiosity. |
04-21-2014, 05:52 PM | #14 | |
null operator (he/him)
Posts: 20,567
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
So it wasn't a dog that ate it, it was MR bear !
Quote:
User (private ?) dictionaries are not implemented as hunspell dictionaries, they're in %APPDATA%calibre\dictionaries\prefs.json Kovid mentioned adding the ability to add a word-list into the spell checker. Maybe my original idea of obtaining the differences between en_GB.dic and en_US.dic via a diff can be revived, perhaps it could be the input into the forthcoming 'add word-list' feature. Or get one of the 'experts' over at libre or apache to build a combined oxt. Active curiosity has been known to kill cats, but by and large its the way we humans learn - I'm not sure there's such a thing as 'idle curiosity', unless one includes 'vicarious interest' in its definition. BR Last edited by BetterRed; 04-21-2014 at 05:57 PM. |
|
04-23-2020, 03:06 PM | #15 |
Groupie
Posts: 171
Karma: 40000
Join Date: Oct 2013
Device: kindle
|
Sorry for the gravedigging: I have the same problem as OP, but the dictionaries I'd like to merge are Italian, with French and/or German and/or English. I tried Hunspell Merge, but it doesn't seem to work with the Italian .dic file (I tried merging two other dictionaries and it does its job).
The command prompt gives some java errors which I have no idea what they mean (see below) Spoiler:
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
New custom English dictionaries | ShellShock | Kobo Developer's Corner | 166 | 09-22-2020 02:48 PM |
[PocketBook Basic] Are there any Early Modern English to Modern English dictionaries? | ProudCabbage | PocketBook | 2 | 11-04-2013 08:49 AM |
PW Russian - English, Italian - English dictionaries? | johanp | Amazon Kindle | 6 | 02-21-2013 02:48 PM |
Spelling: English (UK) versus English (US) | Graham Coulson | General Discussions | 96 | 09-20-2011 01:29 PM |
Russian English Dictionaries | stevegoldstein | PocketBook | 1 | 06-15-2011 06:17 AM |