[Lexicog] Sort order problem

Martin Hosken martin_hosken at SIL.ORG
Thu Mar 9 07:55:57 UTC 2006


Dear Greg,
> I want afuafugogo to be sorted before the string afuafu ni marae by 
> Toolbox. That is, I want Toolbox to ignore the spaces and sort the 
> string as  afuafunimarae. I do not want to actually remove the spaces. 
> Is there some way of getting Toolbox to ignore spaces when sorting?
Toolbox / Shoebox has the ability to do some wild magic when it comes to 
sorting. There are a couple of undocumented? errr. 'extensions' that 
will allow someone with a touch of programming ability to transform a 
string before being passed to the standard Toolbox sort model of primary 
and secondary, etc.

The first is to hand edit, using a program like Notepad, the relevant 
.lng file for the language that you want to hack the sorting for a 
particular sort order. Look through and you will see the sort order of 
interest starting marked by a \+srt and the name of the sort on the 
line, scroll down until you find the corresponding \-srt. Now *before* 
this line, if you insert a line: \cct and a filename (relative to the 
.lng file directory) to a .cct table then when Toolbox sorts a set of 
strings using that particular sort order, each string will be passed 
through that CC table before being sorted. No the data in your database 
doesn't change, it all happens in memory just for the purpose of 
sorting. So if we add a line \cct strip_space.cct and write a 
strip_space.cct:

" " >

wow that was a long CC table!

For those of you who are real hackers you can even have Toolbox call a 
DLL with the string if you don't like CC. Instead of \cct use 
\sortingDll and the filename of a dll relative to the .lng file. This 
DLL needs a function called: void MAKE_SORT_KEY(LPSTR input, LPSTR 
output). And if that makes no sense to you whatsoever, please forget I 
ever said it :)

Yours,
Martin



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/lexicographylist/

<*> To unsubscribe from this group, send an email to:
    lexicographylist-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



More information about the Lexicography mailing list