From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/85192 Path: news.gmane.org!not-for-mail From: "honyk" Newsgroups: gmane.comp.tex.context Subject: Re: Index - custom sorting Date: Mon, 11 Nov 2013 17:36:43 +0100 Message-ID: <13280.6665766568$1384187820@news.gmane.org> References: <527c1030.85230f0a.5bdc.2e27SMTPIN_ADDED_BROKEN@mx.google.com> <8A0670C9-936E-4AA6-A00F-98CD3DE8A581@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1384187810 18154 80.91.229.3 (11 Nov 2013 16:36:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 Nov 2013 16:36:50 +0000 (UTC) To: "'mailing list for ConTeXt users'" Original-X-From: ntg-context-bounces@ntg.nl Mon Nov 11 17:36:56 2013 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VfuTt-0006eb-IZ for gctc-ntg-context-518@m.gmane.org; Mon, 11 Nov 2013 17:36:53 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id A55A3101F9; Mon, 11 Nov 2013 17:36:52 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 14OFstEy4EGB; Mon, 11 Nov 2013 17:36:50 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id AEE3B101EE; Mon, 11 Nov 2013 17:36:50 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 4B2C4101EE for ; Mon, 11 Nov 2013 17:36:49 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id X5G88exB1MfN for ; Mon, 11 Nov 2013 17:36:47 +0100 (CET) Original-Received: from filter4-ams.mf.surf.net (filter4-ams.mf.surf.net [192.87.102.72]) by balder.ntg.nl (Postfix) with ESMTP id C9701101E3 for ; Mon, 11 Nov 2013 17:36:46 +0100 (CET) Original-Received: from fep14.mx.upcmail.net (fep14.mx.upcmail.net [62.179.121.34]) by filter4-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id rABGhNNV004188 for ; Mon, 11 Nov 2013 17:43:26 +0100 Original-Received: from edge01.upcmail.net ([192.168.13.236]) by viefep14-int.chello.at (InterMail vM.8.01.05.05 201-2260-151-110-20120111) with ESMTP id <20131111163643.EFV24775.viefep14-int.chello.at@edge01.upcmail.net> for ; Mon, 11 Nov 2013 17:36:43 +0100 Original-Received: from emk ([89.176.227.177]) by edge01.upcmail.net with edge id oGcj1m0043qH4k901Gcjdi; Mon, 11 Nov 2013 17:36:43 +0100 X-SourceIP: 89.176.227.177 In-Reply-To: <8A0670C9-936E-4AA6-A00F-98CD3DE8A581@gmail.com> X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Ac7cCEg7nkBOdCUHQnmY6p9fJRNbpQC8c/Dg Content-Language: cs X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=62.179.121.34; country=AT; latitude=47.3333; longitude=13.3333; http://maps.google.com/maps?q=47.3333,13.3333&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 01KMgHoUp - a2e49b7fb21e - 20131111 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.72 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:85192 Archived-At: On 2013-11-07 Wolfgang Schuster wrote: > Am 07.11.2013 um 23:11 schrieb honyk : > > > > 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 ___________________________________________________________________________________