<div dir="ltr">Hi Daniel,<br><br>Code points are not the only way to sort it. <br>However, there does need to be a comparison function defined, which will compare two words and give which is bigger.<br>This needs to be used consistently, from module creation to frontend. There could be a library of defined comparators provided by SWORD - but you would need one for each sort order you wanted (which approaches one per language).<br>
<br>Personally, I don&#39;t find that sorted order is particularly important in dictionaries - I would type in a word, and then hope that if it is a different form of the word it would be relatively close. Some frontends may not give the ability to type in words, though. <br>
<br>But I haven&#39;t used dictionaries in other languages, so it may be different for them - especially once diacritics are involved.<br><br>The reasons why dictionaries are different from bibles are:<br>1) Bibles have a known structure, which is hardcoded in the key type (this is going to be able to change soon, for alternate versification, though - probably leading to less efficient modules)<br>
2) Dictionaries can be much, much larger - Websters is a 14Mb download compressed, as compared to the WEB&#39;s ~1.5Mb<br><br>That&#39;s not to say the dictionaries can&#39;t be done more efficiently than they are currently. Looking at the code, they could be quicker for the (common?) case of incrementing a module. Currently they do a binary search for every increment.<br>
Further, they could probably be optimized for key retrieval - which is the really important thing here. (For example by storing the keys separately, uncompressed, 1 key per line)<br><br clear="all">God Bless,<br>Ben<br>-------------------------------------------------------------------------------------------<br>
The Lord is not slow to fulfill his promise as some count slowness,<br>but is patient toward you, not wishing that any should perish,<br>but that all should reach repentance.<br>2 Peter 3:9 (ESV)<br>
<br><br><div class="gmail_quote">On Thu, Sep 18, 2008 at 11:21 AM, Daniel Owens <span dir="ltr">&lt;<a href="mailto:dhowens@pmbx.net">dhowens@pmbx.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">



  
  

<div bgcolor="#ffffff" text="#000000">
<font size="+1"><font face="Arial Unicode MS">Is code point
order the ONLY way to sort dictionary entries? </font></font><font size="+1"><font face="Arial Unicode MS">Surely there is a solution
which would retain the printed or intended order of dictionary entries
without giving up lots of efficiency. If not, I think users would find
a correctly ordered but slower dictionary to one which is fast but
jumbled up.<br>
<br>
At the very least, even if dictionaries aren&#39;t sorted by the printed
order, they should AT LEAST be in alphabetical order. To me that is a
non-negotiable for a dictionary--people depend on dictionaries being in
the right order, and code point order disturbs that for some languages.
Here are a couple of ideas:<br>
&nbsp;&nbsp;&nbsp; - C</font></font><font size="+1"><font face="Arial Unicode MS">ould
a configuration file of some sort be created to define a sorted order
for a given language
that would actually be in alphabetical order?<br>
&nbsp;&nbsp;&nbsp; - Could a dictionary index be created to handle large dictionaries
which allows for the retention of the correct order of entries (whether
that is the printed order or alphabetical order)? <br>
&nbsp;&nbsp;&nbsp; - Bibles are not ordered by code point, and we are able to search
them fairly quickly. Do dictionaries need to be compiled in a fashion
similar to Bibles?<br>
</font></font><font size="+1"><font face="Arial Unicode MS"><br>
As it stands, dictionaries are NOT displayed in alphabetical order (at
least not Vietnamese, and apparently Farsi), which at best looks silly
to the user and at worst means you have to manually hunt around to find
the right entry, making a Genbook more efficient for the user in the
end. But then you lose the dictionary lookup feature. <br>
<br>
Daniel<br>
</font></font><br>
Ben Morgan wrote:
<blockquote type="cite"><div><div></div><div class="Wj3C7c">
  <pre>The issue with ordering as I understand it is that if it is in (some form
of) sorted order, you can use binary search to find entries.
If you want order retained, it is best to use a genbook - but it won&#39;t be as
efficient, and may not have as good UI support.
With huge english dictionaries (like Webster&#39;s, for instance) this becomes
very important.

&gt;From BPBible&#39;s perspective, dictionary handling is done as follows:
1. Read the index of the dictionary and divide by 4 or 6 to get the length
(depending on the driver)
2. Set the virtual list length to the dictionary length
3. When any item is displayed in the virtual list, it retrieves it from the
module.
4. When the user starts typing in the text box above, it does a binary
search to find which item to display.

4 is already quite slow enough on big dictionaries - by having it unsorted,
it would make it quite a lot slower, I imagine.
All the keys from the module would have to be read in, which takes a while.

God Bless,
Ben
-------------------------------------------------------------------------------------------
The Lord is not slow to fulfill his promise as some count slowness,
but is patient toward you, not wishing that any should perish,
but that all should reach repentance.
2 Peter 3:9 (ESV)


On Thu, Sep 18, 2008 at 12:43 AM, Daniel Owens <a href="mailto:dhowens@pmbx.net" target="_blank">&lt;dhowens@pmbx.net&gt;</a> wrote:

  </pre>
  </div></div><blockquote type="cite"><div><div></div><div class="Wj3C7c">
    <pre>mention that byte ordering does some strange things to Vietnamese
dictionaries. The Vietnamese script is a Latin script, but because it uses
some odd characters code point ordering results in illogical and
non-alphabetical entry ordering. For example, the &quot;d&quot; with a line through it
(ð) gets relegated to near the end of the dictionary instead of after the
regular &quot;d&quot; or anything with an apostrophe at the beginning of a word or
phrase gets moved to the top of the list regardless of the first letter
(such as &#39;tis). I am supportive of the IIRC general opinion. Let the module
creator worry about the ordering. Otherwise you get some very strange
dictionary behavior.

    </pre>
    </div></div><pre><hr size="4" width="90%"><div class="Ih2E3d">
_______________________________________________
sword-devel mailing list: <a href="mailto:sword-devel@crosswire.org" target="_blank">sword-devel@crosswire.org</a>
<a href="http://www.crosswire.org/mailman/listinfo/sword-devel" target="_blank">http://www.crosswire.org/mailman/listinfo/sword-devel</a>
Instructions to unsubscribe/change your settings at above page</div></pre>
  </blockquote>
</blockquote>
<br>
<pre cols="72">-- 
PMBX license 1502 
</pre>
</div>


<br>_______________________________________________<br>
sword-devel mailing list: <a href="mailto:sword-devel@crosswire.org">sword-devel@crosswire.org</a><br>
<a href="http://www.crosswire.org/mailman/listinfo/sword-devel" target="_blank">http://www.crosswire.org/mailman/listinfo/sword-devel</a><br>
Instructions to unsubscribe/change your settings at above page<br></blockquote></div><br></div>