[sword-devel] Dictionary ordering

DM Smith dmsmith555 at yahoo.com
Thu Sep 18 08:13:29 MST 2008

Daniel Owens wrote:
> Greg Hellings wrote:
>> On Wed, Sep 17, 2008 at 9:56 PM, Daniel Owens <dhowens at pmbx.net> wrote:
>>> Ben,
>>> Thanks for the explanation. It seems to me that setting up dictionaries to
>>> use key retrieval from an uncompressed file with one key per line (ordered
>>> as the module creator orders it) makes the most sense to me. If that helps
>>> increase efficiency and preserves the order of dictionary entries, then that
>>> is what we want.
>> Would it also be possible to put a space-delimited (or anything else
>> delimited) list of the order that characters ought to be arranged in
>> for a given dictionary?  Then the module creator could put them in
>> whatever is desired in the import file, and the ordering can be based
>> off of the configuration file.  Sorting would be as simple as
>> replacing the characters in each entry with an integer and sorting the
>> resulting vectors.  In the absence of a sort-field, then the module
>> import file's order could default (or the current behavior, whichever
>> is deemed better)?
>> --Greg
> What if one of the TEI elements were an integer (much like Strong's)? 
> The dictionary could be sorted by that integer but entries would not 
> display the integer but rather the actual word entry.
TEI defines a dictionary entry as such:
<entryFree id="G0001" sortKey="G0001">
  <orth xml:lang="grc">Α, α</orth>
  .... more parts ....

Note: sortKey is what you are talking about. It can be anything that can 
be sorted within that dictionary.

Today, from SVN, tei2mod will create a workable SWORD dictionary module. 
Since the TEI filters are fairly barebones and are being improved, it 
will be after or with the next release that TEI dictionaries will  be 

The module that is created uses sortKey for the display and for the 
binary search of the module. tei2mod, IIRC, reorders the entries to 
match a byte ordering of those values.

In Him,

More information about the sword-devel mailing list