04-12-2020, 06:17 AM | #1 |
Groupie
Posts: 171
Karma: 40000
Join Date: Oct 2013
Device: kindle
|
merge two dictionaries into one
Often I correct ebooks which use two or more languages, and running the spellcheck is a bit of a nightmare, because of course I can only select one of the dictionaries at a time, so all the words in the other language are marked as errors. Is there a way to create a new language that is the sum of the two? I tried "Hunspell merge", but it doesn't work.
Thanks |
04-12-2020, 07:27 AM | #2 |
creator of calibre
Posts: 43,866
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
The calibre editor can check multilingual text just fine. Simply add the correct lang="whatever" and the editor will use the appropriate dictionary automatically, assuming it is available.
|
04-12-2020, 07:35 AM | #3 |
Groupie
Posts: 171
Karma: 40000
Join Date: Oct 2013
Device: kindle
|
Thank you for your answer. Can you be more specific, please? Where should I change the language? I tried in the "content.opf" file, but it just resorts to English. Or can I add more languages? What's the code?
|
04-12-2020, 07:38 AM | #4 |
creator of calibre
Posts: 43,866
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
04-12-2020, 07:41 AM | #5 |
Groupie
Posts: 171
Karma: 40000
Join Date: Oct 2013
Device: kindle
|
The problem is the text uses both languages within the same paragraph. It's a file that's already been written, I can't add <span>s around all the words that are in French. I need the spellcheck tool to recognize both the words in Italian and the ones in French.
|
04-12-2020, 08:47 AM | #6 |
creator of calibre
Posts: 43,866
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Then you are out of luck. The Editor can spell check a given language using only a single dictionary and a custom word list. As for merging dictionaries, there may be a way, but not in calibre, it has no dictionary manipulation tools.
|
07-25-2020, 07:29 AM | #7 |
Groupie
Posts: 171
Karma: 40000
Join Date: Oct 2013
Device: kindle
|
Bumping the thread. Finding a solution would save me so much time.
|
07-25-2020, 12:12 PM | #8 |
Bibliophagist
Posts: 35,498
Karma: 145557716
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
The problem is that you want to be able to distinguish a word in French from a word in Italian. Unless you have the words marked, perhaps by the ebook language being set to French and content in Italian being marked as being in Italian, your computer has no way of knowing which dictionary to use unless you want all words checked against both dictionaries which would give rather interesting results.
|
07-25-2020, 03:46 PM | #9 |
Groupie
Posts: 171
Karma: 40000
Join Date: Oct 2013
Device: kindle
|
Yes, I need words checked against both dictionaries, and marked as error only if they don't belong to either. Or, and that is the same logic, I want to check the words against a custom dictionary that is the sum of the Italian and the French one.
You know, those long, highly specific manuals with thousands of foreign words, book titles, and so on. |
07-25-2020, 05:23 PM | #10 |
null operator (he/him)
Posts: 20,583
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
The calibre editor uses Hunpell dictionaries, so maybe this can help:
Use multiple languages at once for the dictionary? - Super User A search for "combine two hunspell dictionaries" may find other solutions. BR |
07-26-2020, 05:15 AM | #11 |
Groupie
Posts: 171
Karma: 40000
Join Date: Oct 2013
Device: kindle
|
I tried Hunspell Merge (which is precisely what I'm looking for), but for some reason it gets stuck when analyzing the Italian dictionary (and this happens only with the Italian dictionary, I've tried merging others and it works. I have zero idea how those .dic files work, so I can't tell what the problem is).
I get this message on the command prompt when running Hunspell merge Exception in thread "Thread-0" java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0 at hunspell.merge.DicReader.readLine(DicReader.java:3 2) at hunspell.merge.FileReader.readFile(FileReader.java :29) at hunspell.merge.DictionaryFile.readFiles(Dictionary File.java:113) at hunspell.merge.HunspellMerge.createDictionariesImp l(HunspellMerge.java:339) at hunspell.merge.HunspellMerge.access$1500(HunspellM erge.java:25) at hunspell.merge.HunspellMerge$9$1.run(HunspellMerge .java:323) at java.base/java.lang.Thread.run(Thread.java:834) Last edited by 1v4n0; 07-26-2020 at 05:25 AM. |
07-26-2020, 06:17 AM | #12 |
null operator (he/him)
Posts: 20,583
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Try to find another Italian hunspell dictionary, Apache might have some, otherwise you will have to log an 'Issue' (on the left) at Google code.
BR Last edited by BetterRed; 07-26-2020 at 06:19 AM. |
08-02-2020, 03:56 AM | #13 | |
Grand Sorcerer
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Merge .zip Dictionaries | Majorix | Kobo Reader | 9 | 10-28-2019 03:09 AM |
Merge books, how to select FIRST book or MERGE metadata? | rboatright | Library Management | 11 | 08-20-2016 11:01 AM |
Just What Does Merge Do? | Pinecone | Library Management | 5 | 01-29-2011 06:43 AM |
What exactly does merge do? | bigpallooka | Calibre | 15 | 11-24-2010 06:58 PM |
Merge feature request (different merge) | Tarran | Calibre | 1 | 05-24-2010 10:57 AM |