ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Index - custom sorting
@ 2013-11-07 22:11 honyk
  0 siblings, 0 replies; 3+ messages in thread
From: honyk @ 2013-11-07 22:11 UTC (permalink / raw)
  To: 'mailing list for ConTeXt users'

Dear All,

czech sorting has a quite complex logic. How can a default index entries
sorting be overridden? 

Using a macro or somewhere under the hood via a lua code? I am a total noob
in this. Btw, as a Java programmer I have it implemented already in Java so
I hope it won't be a huge task to convert it into something else...

Any hint is appreciated.

Jan

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Index - custom sorting
  2013-11-07 22:25 ` Wolfgang Schuster
@ 2013-11-11 16:36   ` honyk
  0 siblings, 0 replies; 3+ messages in thread
From: honyk @ 2013-11-11 16:36 UTC (permalink / raw)
  To: 'mailing list for ConTeXt users'

On 2013-11-07 Wolfgang Schuster wrote: 
> Am 07.11.2013 um 23:11 schrieb honyk <j.tosovsky@email.cz>:
> >
> > czech sorting has a quite complex logic. How can a default index
> > entries sorting be overridden?
> >
> > Using a macro or somewhere under the hood via a lua code? 
> 
> When you have \mainlanguage[cz] in your document context should use 
> the czech sorting mechanism, when you english as main language you 
> can use them in the register
> with \placeregister[index][language=cz].
> 
> You can also influence the sorting with the method key for
> \placeregister: http://www.ntg.nl/pipermail/ntg-
> context/2010/052950.html

That main language is set correctly. While the current implementation
supports a single character order, in czech at least two are required - the
primary one for the first pass and the secondary for the second pass. It
ensures the correct order of accented characters.

Anyway, I dive into the code and found an entry point in the sort-ini.lua
file.
In the comparers.basic(a,b) function I call a customized code instead of
basicsort().

Thanks to my code I can produce desired outputs now ;-)

But all my lua code is directly in that file, which is not ideal as it is
overwritten with every ConTeXt update. Is there any general recommendation
how to make these customization more flexible?

Thanks, Jan

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Index - custom sorting
       [not found] <527c1030.85230f0a.5bdc.2e27SMTPIN_ADDED_BROKEN@mx.google.com>
@ 2013-11-07 22:25 ` Wolfgang Schuster
  2013-11-11 16:36   ` honyk
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Schuster @ 2013-11-07 22:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 07.11.2013 um 23:11 schrieb honyk <j.tosovsky@email.cz>:

> Dear All,
> 
> czech sorting has a quite complex logic. How can a default index entries
> sorting be overridden? 
> 
> Using a macro or somewhere under the hood via a lua code? I am a total noob
> in this. Btw, as a Java programmer I have it implemented already in Java so
> I hope it won't be a huge task to convert it into something else…

When you have \mainlanguage[cz] in your document context should use the czech
sorting mechanism, when you english as main language you can use them in the register
with \placeregister[index][language=cz].

You can also influence the sorting with the method key for \placeregister: http://www.ntg.nl/pipermail/ntg-context/2010/052950.html

Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-11-11 16:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-07 22:11 Index - custom sorting honyk
     [not found] <527c1030.85230f0a.5bdc.2e27SMTPIN_ADDED_BROKEN@mx.google.com>
2013-11-07 22:25 ` Wolfgang Schuster
2013-11-11 16:36   ` honyk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).