Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 04-25-2020, 04:10 AM   #1
annoporci
Enthusiast
annoporci began at the beginning.
 
Posts: 36
Karma: 10
Join Date: Oct 2012
Location: Los Angeles
Device: Kindle Paperwhite 2019, Firmware 5.12.4
Question Make my own Catalan dictionary

Hi!

Short question: would someone be willing to share a template for a dictionary in Catalan that could be used dynamically in a Kindle paperwhite?

By template I mean that the content could be minimal (the letter 'a' only, say). There ought to be no copyright issues. The idea is that I would then fill it in with my own content. I would also like to extend this to other languages like Occitan. Open source electronic dictionaries exist, but I can't find Kindle-compatible versions, so I'm looking to learn a little about how to make my own mobi/azw dictionary.

Background: I have an electronic dictionary which I purchased a while back for another device and which I have converted from epub to mobi and azw with calibre (with no DRM, side note: the conversion took over 10 hours!). The dictionary may be read as a book in my kindle, but does not work dynamically: If I long-press a word in some book, it does not open the dictionary. If I edit the dictionary, I see the text in the html format and it looks quite similar to a dictionary in another language. Catalan does not appear in the list of languages in my Kindle, so I cannot associate the language with a dictionary. This may be because the language is not correctly coded in the dictionary. (I have dictionaries other than Amazon's default dictionaries in languages other than Catalan and they work)

I tried to make my own template with calibre's book edit feature, by taking one of Amazon's dictionaries and editing it down to the bare essentials, changing the language from English to Catalan, but that didn't work: Catalan is still not listed as a language in my list of dictionaries. One of the problems may be about the language code for Catalan. If I inspect the metadata.opf, the language is coded as 'cat', but if I look up a list of language codes, it appears that it should be 'ca'. I tried to edit the metadata.opf, but it does not survive save/export: if I unpack the azw after editing the language tag and saving, it reverts to 'cat'.

So has anyone managed to get a Catalan dictionary work in the Kindle?

If you know of an open source dictionary in Catalan and/or Catalan/Spanish Catalan/Whatever, that would work dynamically in the Kindle, I'd be interested too. Thanks!

EDIT:

You can have a free sample of this dictionary sent to your Kindle. It works as a reference, but does not get listed as a Catalan dictionary and so cannot be used dynamically. This despite the fact that the cover states very clearly "Per al Kindle"!

https://www.amazon.com/Gran-Dicciona...7806178&sr=8-1

Last edited by annoporci; 04-25-2020 at 05:18 AM.
annoporci is offline   Reply With Quote
Old 04-25-2020, 12:07 PM   #2
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 6,496
Karma: 84420419
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
You may find some useful information in the Dictionary FAQ sticky thread in the MobileRead Kindle Forum.

The Amazon Kindle Publishing Guidelines has the specification for creating dictionaries in Chapter 15.
jhowell is offline   Reply With Quote
Advert
Old 04-26-2020, 06:13 PM   #3
annoporci
Enthusiast
annoporci began at the beginning.
 
Posts: 36
Karma: 10
Join Date: Oct 2012
Location: Los Angeles
Device: Kindle Paperwhite 2019, Firmware 5.12.4
Thanks jhowell! I've seen these. I have been able to use default and add extra dictionaries in languages like English, French, Spanish, Italian, without any problem. But for some reason support doesn't seem to extend to the Catalan dictionary. I've tried 3 dictionaries so far, including one that is specifically "designed for the Kindle" (whatever that means). I would have expected that one to work. If someone were willing to give it a try, here's the sample dictionary (available for free from amazon):

https://we.tl/t-JvXu1BBPxN

Does this dictionary get listed for you under Catalan? (or any other language for that matter)

Thanks!
annoporci is offline   Reply With Quote
Old 04-26-2020, 07:27 PM   #4
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 6,496
Karma: 84420419
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
Quote:
Originally Posted by annoporci View Post
Does this dictionary get listed for you under Catalan? (or any other language for that matter)
That file does not have any of the internal coding needed to act as a dictionary for lookups on Kindle.
jhowell is offline   Reply With Quote
Old 04-26-2020, 11:07 PM   #5
annoporci
Enthusiast
annoporci began at the beginning.
 
Posts: 36
Karma: 10
Join Date: Oct 2012
Location: Los Angeles
Device: Kindle Paperwhite 2019, Firmware 5.12.4
I see, thanks. Some early Amazon users reported being able to long-press in their Kindle, but later users complain that it doesn't work, so I guess something must have changed about the formatting. I've now looked inside my Spanish dictionary (which works) and I can see that the formatting is quite different. I'll try to use a hex editor to make a template and fix my Catalan dictionary. I'll report back if I have any success. Thanks again for your feedback.
annoporci is offline   Reply With Quote
Advert
Old 04-27-2020, 08:53 PM   #6
annoporci
Enthusiast
annoporci began at the beginning.
 
Posts: 36
Karma: 10
Join Date: Oct 2012
Location: Los Angeles
Device: Kindle Paperwhite 2019, Firmware 5.12.4
Jhowell, if you have a minute I'd appreciate some hints. Below are the first few lines of code for a Spanish dictionary with look-up and below it a Catalan dictionary that does not support look-up. Do you see a clear way to convert one into the other? (I can write some code for that) Thanks!



Code:
# look-up dictionary
    <mbp:pagebreak/>
    <a id="filepos63413" />
    <mbp:frameset>
    <idx:entry scriptable="yes">
    <idx:orth value="a-">
    <idx:infl>  
    <idx:iform name="" value="a-"/>  
    <idx:iform name="" value="a"/>
    </idx:infl>
    </idx:orth>
    <div><span><b>a-</b></span></div><span>a-<sup>1</sup>. Del lat. <span><i>ad-</i></span>.</span><div><blockquote align="left"><span><b>I. </b></span><span><i>Morfema</i></span><div><blockquote align="left"><span ><span>pref.</span> — <span>Interviene, sin significación precisa, en la formación de algunos derivados. <span><i>Abaratar, acomplejar, acortar, afirmar, amansar.</i></span></span></span></blockquote></div></blockquote></div></idx:entry><hr></hr>
Code:
# book dictionary
    <h2 class="centrat2" id="aid-F8901">A</h2>
      <blockquote class="calibre27">
        <p class="rf">-&gt;a<sup class="calibre32">1</sup></p>
        <p class="df"><code class="calibre22"><sup class="calibre23">■</sup><strong class="calibre13">a</strong></code><sup class="calibre23">1</sup></p>
        <p class="ps">Hom.: <strong class="calibre13">ah</strong></p>
        <p class="p">[<em class="v">pl</em> <em class="calibre24">as</em>] <em class="v">f</em> <strong class="n">1</strong> <span class="v1">ESCR</span> Nom de la primera lletra de l’alfabet català, <em class="ex">a A</em>.</p>
        <p class="p"><strong class="n">2</strong> <strong class="calibre13">no saber ni la a</strong> No saber ni els rudiments d’una cosa.</p>
      </blockquote>

Last edited by annoporci; 04-28-2020 at 04:58 AM.
annoporci is offline   Reply With Quote
Old 04-27-2020, 10:03 PM   #7
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 6,496
Karma: 84420419
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
Quote:
Originally Posted by annoporci View Post
Jhowell, if you have a minute I'd appreciate some hints. Below are the first few lines of code for a Spanish dictionary with look-up and below it a Catalan dictionary that does not support look-up. Do you see a clear way to convert one into the other? (I can write some code for that) Thanks!
The markup for a dictionary is documented in the Kindle Publishing Guidelines that I mentioned previously. You can see it in the working dictionary. It may be possible to do something automatic to reformat your existing dictionary if you can parse out the words, definitions, inflections, etc. Or you might have to manually mark it up manually word by word. It’s a tough problem.
jhowell is offline   Reply With Quote
Old 04-28-2020, 01:15 AM   #8
annoporci
Enthusiast
annoporci began at the beginning.
 
Posts: 36
Karma: 10
Join Date: Oct 2012
Location: Los Angeles
Device: Kindle Paperwhite 2019, Firmware 5.12.4
Thanks jhowell, I need to read the guidelines carefully. :-)
annoporci is offline   Reply With Quote
Old 04-28-2020, 06:41 AM   #9
annoporci
Enthusiast
annoporci began at the beginning.
 
Posts: 36
Karma: 10
Join Date: Oct 2012
Location: Los Angeles
Device: Kindle Paperwhite 2019, Firmware 5.12.4
The guidelines have several things that don't appear in my lookup Spanish dictionary, which is confusing. The `<x-metadata>` for instance.

Anyhow, does the following look like a reasonable template?

The first code is that produced by KindleUnpack. The second code is what I think it should look like to become a lookup dictionary. Maybe you can tell right away if it looks about right or if I'm missing something?

Code:
    <blockquote class="calibre27">
        <p class="rf">-&gt;a<sup class="calibre32">1</sup></p>

        <p class="df"><code class="calibre22"><sup class="calibre23">■</sup><strong class="calibre13">a</strong></code><sup class="calibre23">1</sup></p>

        <p class="ps">Hom.: <strong class="calibre13">ah</strong></p>

        <p class="p">[<em class="v">pl</em> <em class="calibre24">as</em>] <em class="v">f</em> <strong class="n">1</strong> <span class="v1">ESCR</span> Nom de la primera lletra de l’alfabet català, <em class="ex">a A</em>.</p>

        <p class="p"><strong class="n">2</strong> <strong class="calibre13">no saber ni la a</strong> No saber ni els rudiments d’una cosa.</p>
      </blockquote>
Code:
    <idx:entry scriptable="yes">
      <idx:orth value="a">
        <idx:infl>
          <idx:iform name="" value="a"/>  
        </idx:infl>
      </idx:orth>
      <div><span><b>a</b></span></div>
        <span><code><sup>■</sup><strong>a</strong></code><sup>1</sup></span>
        <span>Hom.: <strong>ah</strong></span>
        <span>[<em>pl</em> <em>as</em>] <em>f</em> <strong>1</strong> <span>ESCR</span> Nom de la primera lletra de l’alfabet català, <em>a A</em>.</span>
        <span><strong>2</strong> <strong>no saber ni la a</strong> No saber ni els rudiments d’una cosa.</span>
    </idx:entry>
    <hr></hr>
annoporci is offline   Reply With Quote
Old 04-28-2020, 08:20 AM   #10
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 6,496
Karma: 84420419
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
Quote:
Originally Posted by annoporci View Post
The guidelines have several things that don't appear in my lookup Spanish dictionary, which is confusing. The `<x-metadata>` for instance.
<x-metadata> needs to appear within the <metadata> element of the OPF file.

Quote:
Originally Posted by annoporci View Post
Maybe you can tell right away if it looks about right or if I'm missing something?
It looks OK to me, but it is hard to tell without actually trying it.
jhowell is offline   Reply With Quote
Old 04-28-2020, 06:36 PM   #11
annoporci
Enthusiast
annoporci began at the beginning.
 
Posts: 36
Karma: 10
Join Date: Oct 2012
Location: Los Angeles
Device: Kindle Paperwhite 2019, Firmware 5.12.4
Thanks jhowell! This is encouraging. I'll see if my regexp skill is sufficient to make a workable lookup dictionary (I'm not looking for perfection).

The OPF file I get from the KindleUnpack plugin, taking the Spanish dictionary provided by Amazon for free, does not contain several lines that I would have expected from the Amazon guidelines you referenced. I re-downloaded this dictionary a couple of days ago to make sure I had the latest version and KindleUnpacked it.

As you can see, it doesn't have '<x-metadata>' around <DictionaryInLanguage>es</DictionaryInLanguage>. In any case, getting the OPF file right will be the easiest part of this endeavour.

Code:
<?xml version="1.0" encoding="utf-8"?>
<package version="2.0" xmlns="http://www.idpf.org/2007/opf" unique-identifier="uid">
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf">
<dc:title>Real Academia Española el Diccionario de la lengua española</dc:title>
<dc:language>es</dc:language>
<dc:identifier id="uid">737551192</dc:identifier>
<dc:creator>Real Academia Española</dc:creator>
<dc:contributor>calibre (4.13.0) [https://calibre-ebook.com]</dc:contributor>
<dc:publisher>Amazon Dictionary Account</dc:publisher>
<dc:source>calibre:e1734abb-ad6d-48a2-8012-5bd13419fd53</dc:source>
<dc:date opf:event="publication">0101-01-01 00:00:00+00:00</dc:date>
<meta name="cover" content="cover_img" />
<meta name="output encoding" content="utf-8" />
<!-- BEGIN INFORMATION ONLY 
<meta name="Cover ThumbNail Image" content="Images/image32086.jpeg" />
<meta name="ASIN" content="e1734abb-ad6d-48a2-8012-5bd13419fd53" />
<meta name="Updated_Title" content="Real Academia Española el Diccionario de la lengua española" />
<meta name="Creator-Minor-Version" content="9" />
<meta name="StartOffset" content="98947" />
<meta name="Creator-Build-Tag" content="0730-890adc2" />
<meta name="MetadataResourceURI" content="kindle:embed:0001" />
<meta name="Creator-Software" content="202" />
<meta name="HasFakeCover" content="0" />
<meta name="cdeType" content="EBOK" />
<meta name="Metadata-Record-Offset" content="0" />
<meta name="Creator-Major-Version" content="2" />
<meta name="Embedded-Record-Count" content="2" />
<meta name="Content-Language-Tag" content="es" />
<meta name="Creator-Build-Number" content="0" />
END INFORMATION ONLY -->
</metadata>
<manifest>
<item id="item0" media-type="application/xhtml+xml" href="Text/cover_page.xhtml" />
<item id="item1" media-type="application/xhtml+xml" href="Text/part0000.xhtml" />
<item id="item2" media-type="application/xhtml+xml" href="Text/part0001.xhtml" />
<item id="item3" media-type="application/xhtml+xml" href="Text/part0002.xhtml" />
<item id="item4" media-type="application/xhtml+xml" href="Text/part0003.xhtml" />
<item id="item5" media-type="application/xhtml+xml" href="Text/part0004.xhtml" />
<item id="item6" media-type="application/xhtml+xml" href="Text/part0005.xhtml" />
<item id="item7" media-type="application/xhtml+xml" href="Text/part0006.xhtml" />
<item id="item8" media-type="application/xhtml+xml" href="Text/part0007.xhtml" />
<item id="item9" media-type="application/xhtml+xml" href="Text/part0008.xhtml" />
<item id="item10" media-type="application/xhtml+xml" href="Text/part0009.xhtml" />
<item id="item11" media-type="application/xhtml+xml" href="Text/part0010.xhtml" />
<item id="item12" media-type="application/xhtml+xml" href="Text/part0011.xhtml" />
<item id="item13" media-type="application/xhtml+xml" href="Text/part0012.xhtml" />
<item id="item14" media-type="application/xhtml+xml" href="Text/part0013.xhtml" />
<item id="item15" media-type="application/xhtml+xml" href="Text/part0014.xhtml" />
<item id="item16" media-type="application/xhtml+xml" href="Text/part0015.xhtml" />
<item id="item17" media-type="application/xhtml+xml" href="Text/part0016.xhtml" />
<item id="item18" media-type="application/xhtml+xml" href="Text/part0017.xhtml" />
<item id="item19" media-type="application/xhtml+xml" href="Text/part0018.xhtml" />
<item id="item20" media-type="application/xhtml+xml" href="Text/part0019.xhtml" />
<item id="item21" media-type="application/xhtml+xml" href="Text/part0020.xhtml" />
<item id="item22" media-type="application/xhtml+xml" href="Text/part0021.xhtml" />
<item id="item23" media-type="application/xhtml+xml" href="Text/part0022.xhtml" />
<item id="item24" media-type="application/xhtml+xml" href="Text/part0023.xhtml" />
<item id="item25" media-type="application/xhtml+xml" href="Text/part0024.xhtml" />
<item id="item26" media-type="application/xhtml+xml" href="Text/part0025.xhtml" />
<item id="item27" media-type="application/xhtml+xml" href="Text/part0026.xhtml" />
<item id="item28" media-type="application/xhtml+xml" href="Text/part0027.xhtml" />
<item id="item29" media-type="application/xhtml+xml" href="Text/part0028.xhtml" />
<item id="item30" media-type="application/xhtml+xml" href="Text/part0029.xhtml" />
<item id="item31" media-type="application/xhtml+xml" href="Text/part0030.xhtml" />
<item id="item32" media-type="application/xhtml+xml" href="Text/part0031.xhtml" />
<item id="item33" media-type="application/xhtml+xml" href="Text/part0032.xhtml" />
<item id="item34" media-type="application/xhtml+xml" href="Text/part0033.xhtml" />
<item id="item35" media-type="application/xhtml+xml" href="Text/part0034.xhtml" />
<item id="item36" media-type="application/xhtml+xml" href="Text/part0035.xhtml" />
<item id="item37" media-type="application/xhtml+xml" href="Text/part0036.xhtml" />
<item id="item38" media-type="application/xhtml+xml" href="Text/part0037.xhtml" />
<item id="item39" media-type="application/xhtml+xml" href="Text/part0038.xhtml" />
<item id="item40" media-type="application/xhtml+xml" href="Text/part0039.xhtml" />
<item id="item41" media-type="application/xhtml+xml" href="Text/part0040.xhtml" />
<item id="item42" media-type="application/xhtml+xml" href="Text/part0041.xhtml" />
<item id="item43" media-type="application/xhtml+xml" href="Text/part0042.xhtml" />
<item id="item44" media-type="application/xhtml+xml" href="Text/part0043.xhtml" />
<item id="item45" media-type="application/xhtml+xml" href="Text/part0044.xhtml" />
<item id="item46" media-type="application/xhtml+xml" href="Text/part0045.xhtml" />
<item id="item47" media-type="application/xhtml+xml" href="Text/part0046.xhtml" />
<item id="item48" media-type="application/xhtml+xml" href="Text/part0047.xhtml" />
<item id="item49" media-type="application/xhtml+xml" href="Text/part0048.xhtml" />
<item id="item50" media-type="application/xhtml+xml" href="Text/part0049.xhtml" />
<item id="item51" media-type="application/xhtml+xml" href="Text/part0050.xhtml" />
<item id="item52" media-type="application/xhtml+xml" href="Text/part0051.xhtml" />
<item id="item53" media-type="application/xhtml+xml" href="Text/part0052.xhtml" />
<item id="item54" media-type="application/xhtml+xml" href="Text/part0053.xhtml" />
<item id="item55" media-type="application/xhtml+xml" href="Text/part0054.xhtml" />
<item id="item56" media-type="application/xhtml+xml" href="Text/part0055.xhtml" />
<item id="item57" media-type="application/xhtml+xml" href="Text/part0056.xhtml" />
<item id="item58" media-type="application/xhtml+xml" href="Text/part0057.xhtml" />
<item id="item59" media-type="application/xhtml+xml" href="Text/part0058.xhtml" />
<item id="item60" media-type="application/xhtml+xml" href="Text/part0059.xhtml" />
<item id="item61" media-type="application/xhtml+xml" href="Text/part0060.xhtml" />
<item id="item62" media-type="application/xhtml+xml" href="Text/part0061.xhtml" />
<item id="item63" media-type="application/xhtml+xml" href="Text/part0062.xhtml" />
<item id="item64" media-type="application/xhtml+xml" href="Text/part0063.xhtml" />
<item id="item65" media-type="application/xhtml+xml" href="Text/part0064.xhtml" />
<item id="item66" media-type="application/xhtml+xml" href="Text/part0065.xhtml" />
<item id="item67" media-type="application/xhtml+xml" href="Text/part0066.xhtml" />
<item id="item68" media-type="application/xhtml+xml" href="Text/part0067.xhtml" />
<item id="item69" media-type="application/xhtml+xml" href="Text/part0068.xhtml" />
<item id="item70" media-type="application/xhtml+xml" href="Text/part0069.xhtml" />
<item id="item71" media-type="application/xhtml+xml" href="Text/part0070.xhtml" />
<item id="item72" media-type="application/xhtml+xml" href="Text/part0071.xhtml" />
<item id="item73" media-type="application/xhtml+xml" href="Text/part0072.xhtml" />
<item id="item74" media-type="application/xhtml+xml" href="Text/part0073.xhtml" />
<item id="item75" media-type="application/xhtml+xml" href="Text/part0074.xhtml" />
<item id="item76" media-type="application/xhtml+xml" href="Text/part0075.xhtml" />
<item id="item77" media-type="application/xhtml+xml" href="Text/part0076.xhtml" />
<item id="item78" media-type="application/xhtml+xml" href="Text/part0077.xhtml" />
<item id="item79" media-type="application/xhtml+xml" href="Text/part0078.xhtml" />
<item id="item80" media-type="application/xhtml+xml" href="Text/part0079.xhtml" />
<item id="item81" media-type="application/xhtml+xml" href="Text/part0080.xhtml" />
<item id="item82" media-type="application/xhtml+xml" href="Text/part0081.xhtml" />
<item id="item83" media-type="application/xhtml+xml" href="Text/part0082.xhtml" />
<item id="item84" media-type="application/xhtml+xml" href="Text/part0083.xhtml" />
<item id="item85" media-type="application/xhtml+xml" href="Text/part0084.xhtml" />
<item id="item86" media-type="application/xhtml+xml" href="Text/part0085.xhtml" />
<item id="item87" media-type="application/xhtml+xml" href="Text/part0086.xhtml" />
<item id="item88" media-type="application/xhtml+xml" href="Text/part0087.xhtml" />
<item id="item89" media-type="application/xhtml+xml" href="Text/part0088.xhtml" />
<item id="item90" media-type="application/xhtml+xml" href="Text/part0089.xhtml" />
<item id="item91" media-type="application/xhtml+xml" href="Text/part0090.xhtml" />
<item id="item92" media-type="application/xhtml+xml" href="Text/part0091.xhtml" />
<item id="item93" media-type="application/xhtml+xml" href="Text/part0092.xhtml" />
<item id="item94" media-type="application/xhtml+xml" href="Text/part0093.xhtml" />
<item id="item95" media-type="application/xhtml+xml" href="Text/part0094.xhtml" />
<item id="item96" media-type="application/xhtml+xml" href="Text/part0095.xhtml" />
<item id="item97" media-type="application/xhtml+xml" href="Text/part0096.xhtml" />
<item id="item98" media-type="text/css" href="Styles/style0001.css" />
<item id="item99" media-type="text/css" href="Styles/style0002.css" />
<item id="cover_img" media-type="image/jpeg" href="Images/cover32085.jpeg" />
<item id="ncx" media-type="application/x-dtbncx+xml" href="toc.ncx" />
</manifest>
<spine toc="ncx">
<itemref idref="item0" linear="no"/>
<itemref idref="item1"/>
<itemref idref="item2"/>
<itemref idref="item3"/>
<itemref idref="item4"/>
<itemref idref="item5"/>
<itemref idref="item6"/>
<itemref idref="item7"/>
<itemref idref="item8"/>
<itemref idref="item9"/>
<itemref idref="item10"/>
<itemref idref="item11"/>
<itemref idref="item12"/>
<itemref idref="item13"/>
<itemref idref="item14"/>
<itemref idref="item15"/>
<itemref idref="item16"/>
<itemref idref="item17"/>
<itemref idref="item18"/>
<itemref idref="item19"/>
<itemref idref="item20"/>
<itemref idref="item21"/>
<itemref idref="item22"/>
<itemref idref="item23"/>
<itemref idref="item24"/>
<itemref idref="item25"/>
<itemref idref="item26"/>
<itemref idref="item27"/>
<itemref idref="item28"/>
<itemref idref="item29"/>
<itemref idref="item30"/>
<itemref idref="item31"/>
<itemref idref="item32"/>
<itemref idref="item33"/>
<itemref idref="item34"/>
<itemref idref="item35"/>
<itemref idref="item36"/>
<itemref idref="item37"/>
<itemref idref="item38"/>
<itemref idref="item39"/>
<itemref idref="item40"/>
<itemref idref="item41"/>
<itemref idref="item42"/>
<itemref idref="item43"/>
<itemref idref="item44"/>
<itemref idref="item45"/>
<itemref idref="item46"/>
<itemref idref="item47"/>
<itemref idref="item48"/>
<itemref idref="item49"/>
<itemref idref="item50"/>
<itemref idref="item51"/>
<itemref idref="item52"/>
<itemref idref="item53"/>
<itemref idref="item54"/>
<itemref idref="item55"/>
<itemref idref="item56"/>
<itemref idref="item57"/>
<itemref idref="item58"/>
<itemref idref="item59"/>
<itemref idref="item60"/>
<itemref idref="item61"/>
<itemref idref="item62"/>
<itemref idref="item63"/>
<itemref idref="item64"/>
<itemref idref="item65"/>
<itemref idref="item66"/>
<itemref idref="item67"/>
<itemref idref="item68"/>
<itemref idref="item69"/>
<itemref idref="item70"/>
<itemref idref="item71"/>
<itemref idref="item72"/>
<itemref idref="item73"/>
<itemref idref="item74"/>
<itemref idref="item75"/>
<itemref idref="item76"/>
<itemref idref="item77"/>
<itemref idref="item78"/>
<itemref idref="item79"/>
<itemref idref="item80"/>
<itemref idref="item81"/>
<itemref idref="item82"/>
<itemref idref="item83"/>
<itemref idref="item84"/>
<itemref idref="item85"/>
<itemref idref="item86"/>
<itemref idref="item87"/>
<itemref idref="item88"/>
<itemref idref="item89"/>
<itemref idref="item90"/>
<itemref idref="item91"/>
<itemref idref="item92"/>
<itemref idref="item93"/>
<itemref idref="item94"/>
<itemref idref="item95"/>
<itemref idref="item96"/>
<itemref idref="item97"/>
</spine>
<tours>
</tours>
<guide>
<reference type="text" title="Comenzando" href="Text/part0005.xhtml#aid-4OIQ2" />
<reference type="toc" title="Contenido" href="Text/part0000.xhtml#filepos166" />
<reference type="cover" title="Cover" href="Text/cover_page.xhtml" />
</guide>
</package>
NOTE: When I first posted, I included the wrong OPF. That mistake was corrected after about 10 minutes.

Last edited by annoporci; 04-28-2020 at 06:44 PM.
annoporci is offline   Reply With Quote
Old 04-28-2020, 10:38 PM   #12
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 6,496
Karma: 84420419
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
Quote:
Originally Posted by annoporci View Post
As you can see, it doesn't have '<x-metadata>' around <DictionaryInLanguage>es</DictionaryInLanguage>. In any case, getting the OPF file right will be the easiest part of this endeavour.
MOBI format does not contain an actual OPF. The OPF produced by Kindleunpack is a reconstruction, which is not completely correct in this case. It may actually work whether or not <x-metadata> is used as a wrapper for those elements, but I haven't tested it.


Quote:
Originally Posted by annoporci View Post
NOTE: When I first posted, I included the wrong OPF. That mistake was corrected after about 10 minutes.
Something is wrong with your revised post. The OPF shown does not include <DictionaryInLanguage> or <DictionaryOutLanguage> at all.
jhowell is offline   Reply With Quote
Old 04-29-2020, 05:51 AM   #13
annoporci
Enthusiast
annoporci began at the beginning.
 
Posts: 36
Karma: 10
Join Date: Oct 2012
Location: Los Angeles
Device: Kindle Paperwhite 2019, Firmware 5.12.4
EDIT Oh wait, I understand. When I converted the mobi file to azw, the lookup dictionary features were lost. Silly me. So the relevant OPF is indeed the one below, taken from the mobi file, which contains the <DictionaryInLanguage> and <DictionaryOutLanguage> declarations in the preamble. Apologies for the noise.

Quote:
Originally Posted by jhowell View Post
Something is wrong with your revised post. The OPF shown does not include <DictionaryInLanguage> or <DictionaryOutLanguage> at all.
The OPF shown above was created from the original azw file via the KindleUnpack plugin. Only the <dc:language>es</dc:language> declaration appears (inside the mobi8/OEBPS directory).

I also converted the azw to mobi via calibre and used KindleUnpack to obtain another OPF. There the <DictionaryInLanguage>es</DictionaryInLanguage> and <DictionaryOutLanguage>es</DictionaryOutLanguage> declarations appear (inside the mobi7 directory). But not inside x-metadata tags.

For completeness, below is the OPF associated with the unpacked mobi (exact same dictionary file to begin with):

Code:
<?xml version="1.0" encoding="utf-8"?>
<package version="2.0" xmlns="http://www.idpf.org/2007/opf" unique-identifier="uid">
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf">
<dc:title>Diccionario de la lengua española</dc:title>
<dc:language>es</dc:language>
<dc:identifier id="uid">3172006083</dc:identifier>
<dc:creator>Real Academia Española</dc:creator>
<dc:contributor>Amazon Kindle Special Conversions</dc:contributor>
<dc:publisher>Amazon Dictionary Account</dc:publisher>
<dc:date opf:event="publication"> </dc:date>
<meta name="cover" content="cover_img" />
<meta name="output encoding" content="utf-8" />
<DictionaryInLanguage>es</DictionaryInLanguage>
<DictionaryOutLanguage>es</DictionaryOutLanguage>
<meta name="primary-writing-mode" content="horizontal-lr" />
<!-- BEGIN INFORMATION ONLY 
<meta name="Cover ThumbNail Image" content="Images/image16934.jpeg" />
<meta name="Drm Ebookbase Book Id" content="0000000449033" />
<meta name="ASIN" content="B005064LTK" />
<meta name="Content-Language-Tag" content="es" />
<meta name="Creator-Build-Number" content="0" />
<meta name="Metadata-Record-Offset" content="0" />
<meta name="Unknown_(407)_(hex)" content="0000000000000000" />
<meta name="Ownership-Type_(hex)" content="00" />
<meta name="Container_Id" content="1waE" />
<meta name="cdeType" content="EBOK" />
<meta name="HasFakeCover" content="0" />
<meta name="Text-to-Speech-Disabled" content="0" />
<meta name="Dictionary_In_Langague" content="es" />
<meta name="Creator-Minor-Version" content="9" />
<meta name="Embedded-Record-Count" content="3" />
<meta name="Font-Signature_(hex)" content="ff0000e052600000000000000000008000200000000000000000000000000000f4edecbe01ed01fa01e901e102eb02cd028102ab03e703f003d003dd04e905e3068c06810684068607bd07b907bf07ba3ca53c973cd33ce33ef53efb3ef93efd40924094409340964098409940a240a641ac42e042ee449a44e544e444924ba14bba4bcb4ba04ced" />
<meta name="Updated_Title" content="Real Academia Española el Diccionario de la lengua española" />
<meta name="Creator-Major-Version" content="2" />
<meta name="CDEContentKey" content="B005064LTK" />
<meta name="Rental-Expiration-Time" content="0000000000000000" />
<meta name="Creator-Build-Tag" content="1029-0897292" />
<meta name="Creator-Software" content="200" />
<meta name="Tamper-Proof-Keys_(hex)" content="01000000d000000001940000000191000000019500000001960000000197" />
<meta name="Watermark_(hex)" content="6174763a6b696e3a323a37495831337a5a4b4638516445323738777438716f364f7a6464427659717655346b65353763332f4c3658786f7161315154624f526c677667487166566a77454848545738596d4a6575494350674169614c345a30714c7830655265574f4d4e31454e384579454d67306e477871366237762b5932386f4a5a42616245482b7143776d3174335a6d534a2f3175334f6b4769556c7669422b6a5853316f4268315675394c355a4e5857687a514e3854435470453961445764456b316f54675a593a5968476163366b717337482b38436143685937434e52716e4f41633d" />
<meta name="Clipping-Limit" content="100" />
<meta name="override-kindle-fonts" content="false" />
<meta name="Unknown_(403)_(hex)" content="00" />
<meta name="sample" content="0" />
<meta name="547 (hex)" content="49006e004d0065006d006f0072007900" />
<meta name="Dictionary_Out_Language" content="es" />
<meta name="StartOffset" content="4294967295" />
END INFORMATION ONLY -->
</metadata>
<manifest>
<item id="item0" media-type="text/html" href="book.html" />
<item id="cover_img" media-type="image/jpeg" href="Images/cover16933.jpeg" />
<item id="ncx" media-type="application/x-dtbncx+xml" href="toc.ncx" />
</manifest>
<spine toc="ncx">
<itemref idref="item0"/>
</spine>
<tours>
</tours>
<guide>
<reference title="Contenido" type="toc"  href="book.html#filepos166" /><reference title="Comenzando" type="text"  href="book.html#filepos63413" />
<reference type="text" href="book.html#filepos0" />
</guide>
</package>
I prefer the structure obtained from the azw file because the text is broken down into multiple, smaller files (partXXXX.xhtml), rather than a single file ('book.html'), which is easier to handle.

Last edited by annoporci; 04-29-2020 at 06:16 AM.
annoporci is offline   Reply With Quote
Old 04-29-2020, 08:08 AM   #14
mikapanja
Perfectionist
mikapanja can solve quadratic equations while standing on his or her head reciting poetry in iambic pentametermikapanja can solve quadratic equations while standing on his or her head reciting poetry in iambic pentametermikapanja can solve quadratic equations while standing on his or her head reciting poetry in iambic pentametermikapanja can solve quadratic equations while standing on his or her head reciting poetry in iambic pentametermikapanja can solve quadratic equations while standing on his or her head reciting poetry in iambic pentametermikapanja can solve quadratic equations while standing on his or her head reciting poetry in iambic pentametermikapanja can solve quadratic equations while standing on his or her head reciting poetry in iambic pentametermikapanja can solve quadratic equations while standing on his or her head reciting poetry in iambic pentametermikapanja can solve quadratic equations while standing on his or her head reciting poetry in iambic pentametermikapanja can solve quadratic equations while standing on his or her head reciting poetry in iambic pentametermikapanja can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameter
 
Posts: 62
Karma: 12802
Join Date: Apr 2014
Device: none
Quote:
Originally Posted by jhowell View Post
MOBI format does not contain an actual OPF. The OPF produced by Kindleunpack is a reconstruction...
How can one open and read a MOBI book if it doesn't contain an OPF? What happens internally? And how does KindleUpack reconstruct it?
mikapanja is offline   Reply With Quote
Old 04-29-2020, 09:57 AM   #15
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 6,496
Karma: 84420419
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
Quote:
Originally Posted by mikapanja View Post
How can one open and read a MOBI book if it doesn't contain an OPF? What happens internally? And how does KindleUpack reconstruct it?
OPF is part of the EPUB specification. EPUB uses zipped XML files for metadata.

MOBI format predates EPUB and uses binary structures for metadata. You can read more about it here.

Both calibre and Kindleunpack contain a significant amount of software to read MOBI format and generate the EPUB equivalent for the various data structures involved.
jhowell is offline   Reply With Quote
Reply

Tags
dictionary, dictionary language, edit book, kindle


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Make Dictionary layout look Pretty lotteryticket KOReader 2 12-01-2019 03:45 AM
How to make Kindle *not* recognize dictionary benjavi Amazon Kindle 1 07-17-2017 12:18 AM
Is it possible to make 2 languages dictionary in the same file animal1234 Kindle Formats 2 09-01-2016 10:28 PM
Can anyone make a new dictionary for prs? zcqsimon Sony Reader 0 10-23-2010 09:54 AM


All times are GMT -4. The time now is 01:37 AM.


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