View Single Post
Old 10-14-2021, 07:02 AM   #5
helrasincke
Junior Member
helrasincke began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Sep 2020
Device: Kindle Touch 4
Quote:
Originally Posted by Doitsu View Post
After I wrote my initial reply, I also attached the source code for a Russian-English dictionary with two entries with working inflections.
Have you already looked at it and tested it?
My apologies that I did not see this earlier. I'm really very grateful for you putting that sample together, however looking through the file it seems there may have been a misunderstanding about what I was hoping to achieve. I don't have any issues generating the file or getting it to recognise as a dictionary. I even agree the inflection tags can be handy, but I've spent a fair amount experimenting with various dictionaries, and have found that at least for my usage, they're just not worth the extra effort to collate. Since I know or can guess at basic forms in the languages I read and have the luxury of a spare device anyway, I prefer to use the KT as a stand-alone dictionary and search via index lookup. All of the necessary inflection information (e.g. <b>сня́ться:</b> сниму́сь, сни́мешься, etc.) is displayed visually as part of the entry itself. This is enough for my purpose.

Having more or less solved the problem now at this point, I'll summarise the findings in case it is of interest to anyone out there. The following approaches showed varying levels of success:

• Compiling with only the cyrillic forms works great on PW with the Russian keyboard enabled, but obviously can't be accessed via keyboard lookup on stock KT;
• Compiling with a fully transliterated index forms works on KT but then I can't use the more convenient cyrillic keyboard on PW - it's an edge case for me admittedly, but after all the effort, I want it to be as forward compatible as possible.
• Finally, coming back to my idea of the dual from index (trying cyrillic headword with transliterations in inflection tags) – the index would just default to cyrillic even with a latin key input, I just couldn't get it working... well, until I decided to just throw in the towel and use the dsl2mobi script to see what it spat out, since I could see they were essentially going for the same approach (plus, it generates the inflection tags for free!). It turns out the opposite order – using transliterated headword – does work. And the key piece of the puzzle seems to be using the cyrillic headword as the unique entry id.

Here is my original approach with dual scripts, but only the cyrillic index works:

Code:
<?xml version="1.0" encoding="utf-8"?>
<html xmlns:idx="www.mobipocket.com" xmlns:mbp="www.mobipocket.com" xmlns:xlink="http://www.w3.org/1999/xlink">
  <head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
  </head>
<body>
<mbp:frameset>

<idx:entry name="headword" scriptable="yes" id="66154">
  <idx:short><a id="66154"></a>
    <idx:orth value="сняться">
      <idx:infl>
        <idx:iform value="snyatsya">
      </idx:infl>
    </idx:orth>
      <b>сня́ться </b>
        <div>сниму́сь, сни́мешься; <i>прош.</i> сня́лся, -ла́сь, -ло́сь; <i>сов.</i> (<i>несов.</i> снима́ться). [...]</div>
  </idx:short>
</idx:entry>
<hr>

</mbp:frameset>
</body>
</html>
And here is the dsl2mobi output, which handles either index:

Code:
<?xml version="1.0" encoding="utf-8"?>
<html xmlns:idx="www.mobipocket.com" xmlns:mbp="www.mobipocket.com" xmlns:xlink="http://www.w3.org/1999/xlink">
  <head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
  </head>
<body>
<mbp:frameset>

<a name="#сняться"/>
  <idx:entry name="headword" scriptable="yes">
    <idx:orth>
      <b>сня́ться</b>
    </idx:orth>
      <idx:orth value="snyatsya"/>
        <div>сниму́сь, сни́мешься; <i>прош.</i> сня́лся, -ла́сь, -ло́сь; <i>сов.</i> (<i>несов.</i> снима́ться). [...]</div>
  </idx:entry>
<hr>

</mbp:frameset>
</body>
</html>
So there you have it, I managed to solve the problem of dual script lookup. And what's the lesson? Next time I'll just use the script...
helrasincke is offline   Reply With Quote