![]() |
#1 |
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 22
Karma: 475242
Join Date: Nov 2012
Device: Kindle Paperwhite
|
How to use 'format' in <idx:orth> tags for dictionaries?
I'm having a really hard time trying to figure out how to use the change/format what the Kindle displays in the index of a dictionary.
This is what I would like to achieve: for a given headword, when searching in the index, display 'headword [phonetic reading]'. Code:
<idx:entry name="word" scriptable="yes"> <h3>頭</h3> <idx:orth format="orth 【あたま】">頭</idx:orth>; <idx:orth>首 【あたま】</idx:orth> 【あたま; かしら; かぶり; こうべ; ず; つむり; つぶり; つむ; かぶ】 <br /> (noun) (1) head; (2) mind; brain; intellect; (3) top; (4) hair (on one's head); (5) bangs; fringe; (6) top structural component of a kanji <br /> </idx:entry> <hr /> <br /> ![]() I've read the mobi documentation at http://www.mobipocket.com/dev/articl...e=indexing.htm have tried using single quotes and idx:string but nothing seems to work. Any help or suggestions is greealty appreciated! |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,687
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
Try this:
Code:
<html> <body> <idx:entry> <idx:orth value="頭"> <idx:infl><idx:iform value="首"/></idx:infl> </idx:orth> <h3>頭 【あたま】首 【あたま】</h3> 【あたま; かしら; かぶり; こうべ; ず; つむり; つぶり; つむ; かぶ】<br /> (noun) (1) head; (2) mind; brain; intellect; (3) top; (4) hair (on one's head); (5) bangs; fringe; (6) top structural component of a kanji<br /> </idx:entry> </body> </html> This defines 首 as a variant of 頭 and looking up either of these Kanjis will display the same entry. |
![]() |
![]() |
![]() |
#3 | |
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 22
Karma: 475242
Join Date: Nov 2012
Device: Kindle Paperwhite
|
Quote:
Perhaps I didn't quite explain what I wanted to do. I'll try and explain more clearly. The issue I have is not with what the dictionary entry/definition displays, it's with what is displayed in the index list. By this I mean when a user has the dictionary already opened and does a search within the dictionary. When you do this the Kindle displays a list of all the index entries (in alphabetical order). [If this is still not clear let me know and I will try and upload screen shots] Currently I have this code: Code:
<idx:entry name="word" scriptable="yes"> <h3>頭</h3> <idx:orth>頭</idx:orth>; <idx:orth>首</idx:orth> 【あたま; かしら; かぶり; こうべ; ず; つむり; つぶり; つむ; かぶ】<br /> (noun) (1) head; (2) mind; brain; intellect; (3) top; (4) hair (on one's head); (5) bangs; fringe; (6) top structural component of a kanji <br /> </idx:entry> <hr /> <br /> The problems is that in the index, what is displayed is 頭 (and only that). I would like to display the kanji *and* the reading when the index list is being displayed. In other words I would like this displayed "頭 【あたま】" I can't find anyway of doing this that doesn't break the index. I know it can be done though because the 大辞典 dictionary that comes free with the Kindle Paperwhite does just that ... Any suggestions are most welcomed! (*) In case where an entry has more than one possible kanji I'm having difficulty deciding if I should use my method of multiple orth's or use inflections instead. With inflections users could get confused when doing an in-dictionary index lookup - the user is looking for 首 and the index shows 頭. Unless you already that one is an inflection of the other it can be confusing. On the other hand, using multiple orth's also has a big drawback. 首 is an inflection (alternate writing) of 頭, but it *also* has it's entry (neck) which unrelated to 頭! Doing an index lookup will display two entries for 首, which I can live with. The issue comes up when doing a look-up when reading a book. If you look-up 首, the Kindle will jump to the entry for 頭 (head) which is incorrect ... it should have gone to 首 (neck). |
|
![]() |
![]() |
![]() |
#4 | ||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,687
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
Quote:
That's an unfortunate limitation of the Kindle that you can't do anything about other than complaining about it to the Kinde developers. |
||
![]() |
![]() |
![]() |
#5 | |
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 22
Karma: 475242
Join Date: Nov 2012
Device: Kindle Paperwhite
|
Quote:
I can't figure out how they did it. I decompiled the dictionary and I can see that they use <idx:orth value=""> but I can't tell what the value is ... it looks like a pointer into the index file. I even opened up an index file in a hex editor, but it's unreadable. Code:
<idx:entry> <idx:orth value="^C"A"> </idx:entry> <b>あたま</b>【頭】<br/> <b>1</b> 動物の体の上 ... Last edited by totsubo; 03-03-2013 at 08:03 AM. |
|
![]() |
![]() |
![]() |
#6 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,687
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
Code:
<html> <body> <idx:entry> <idx:orth value="二 【に】"> <idx:infl><idx:iform value="二"/></idx:infl> </idx:orth> 二 【に】<br /> Two<br /><br /> </idx:entry> <idx:entry> <idx:orth value="頭 【ねこ】"> <idx:infl><idx:iform value="頭"/></idx:infl> </idx:orth> 頭 【ねこ】<br /> Cat<br /><br /> </idx:entry> <idx:entry> <idx:orth value="猫 【あたま】"> <idx:infl><idx:iform value="猫"/></idx:infl> </idx:orth> <idx:orth value="首 【あたま】"> <idx:infl><idx:iform value="首"/></idx:infl> </idx:orth> [首 【あたま】首 【あたま】<br /> (noun) (1) head; (2) mind; brain; intellect; (3) top; (4) hair (on one's head); (5) bangs; fringe; (6) top structural component of a kanji<br /><br /> </idx:entry> </body> </html> Last edited by Doitsu; 03-04-2013 at 10:33 AM. Reason: Removed extra spaces in code listing. |
|
![]() |
![]() |
![]() |
#7 | |
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 22
Karma: 475242
Join Date: Nov 2012
Device: Kindle Paperwhite
|
Doitsu, thanks again for the suggestions. I'm really clutching at straws so appreciate your ideas.
I've tried a version of what you suggested. Here's the file I created: Code:
<html> <body> <idx:entry name="word" scriptable="yes"> <idx:orth value="頭 【あたま】"> <idx:infl><idx:iform value="頭"/></idx:infl> </idx:orth> Head </idx:entry> </body> </html> The documentation has this to say for the value attribute: Quote:
![]() |
|
![]() |
![]() |
![]() |
#8 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,687
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
Maybe your problems are caused by the name="word" scriptable="yes" attributes. I never used labels and I have no idea what they mean by OEB flow either, but my dictionaries usually worked just fine. Last edited by Doitsu; 03-04-2013 at 10:01 AM. |
|
![]() |
![]() |
![]() |
#9 |
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 22
Karma: 475242
Join Date: Nov 2012
Device: Kindle Paperwhite
|
Thanks for the files Doitsu. I used kindlegen to convert the html to a dictionary using my opf file and it works. A big thank you!
A few observations: 1- There are only three index entries. 首 doesn't show in the index 2- An index search for 首 brings up nothing, but 'clicking' on the search box's 'go to' arrow take me to the correct entry for 頭. I did a bit more testing by adding one more entry with 3 inflections and then 首 showed up but only the first two inflections of the new entry was displayed in the index list. Very strange. Looks like the last inflection of the file is never displayed. Wonder if this is a bug with kindlegen. |
![]() |
![]() |
![]() |
#10 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,687
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
Code:
<idx:orth value="猫 【あたま】"> <idx:infl><idx:iform value="猫 "/></idx:infl> </idx:orth> <idx:orth value="首 【あたま】"> <idx:infl><idx:iform value="首 "/></idx:infl> </idx:orth> |
|
![]() |
![]() |
![]() |
#11 | |
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 22
Karma: 475242
Join Date: Nov 2012
Device: Kindle Paperwhite
|
Quote:
With a 'fixed' file do your reader show all index entries or just three? I'd like to test if this is a bug with kindlegen or the Kindle itself by testing a prc file versus an azw file. Where can I get the software that you used to generate the prc (for Mac)? |
|
![]() |
![]() |
![]() |
#12 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,687
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
![]() Maybe you can find an older Mac KindleGen 1.x version on the Internet. It also couldn't hurt to test your files with the latest KindleGen 2.8. |
|
![]() |
![]() |
![]() |
#13 |
Member
![]() Posts: 12
Karma: 10
Join Date: Nov 2012
Location: Philippines
Device: Kindle Fire, Kindle Fire HD, Amazon Kindle PW, Nook Color, Nook Tablet
|
Hi there, does anyone here accept eDictionary conversion service. Thanks.
|
![]() |
![]() |
![]() |
Tags |
dictionary, format, idx, mobi, orth |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Searching tags to show tags I want even when it has a tag I do not | Jade Aislin | Library Management | 2 | 04-25-2012 01:01 PM |
Hierarchical tags and their format on book details | Noughty | Library Management | 12 | 02-19-2012 07:47 AM |
Amazon Tags - Popular tags vs Unique tags. | chrisanthropic | Writers' Corner | 6 | 09-19-2011 11:18 PM |
on converting .mobi dictionaries to pb format | teofrast | PocketBook | 8 | 02-28-2011 04:26 PM |
tab2opf.py <idx:key key="xxx"> | Doitsu | Kindle Formats | 0 | 01-11-2011 11:57 AM |