[NTG-context] Preparing a weird index.

Gour gour at atmarama.net
Fri Jun 27 07:42:25 CEST 2014

Hans Hagen <pragma at wxs.nl> writes:

> i don't know xindy but normally the context mkiv index mechanism is
> flexible enough (and it can be configured)

Here are some snippets from my old xindy setup...

;; define order of sorting runs
(use-rule-set :run 0
              :rule-set ("resolve-sanskrit-diacritics" "hr-alphabetize" 
(use-rule-set :run 1
              :rule-set ("hr-resolve-diacritics" "hr-ignore-special"))
(use-rule-set :run 2
              :rule-set ("hr-resolve-case" "hr-ignore-special"))
(use-rule-set :run 3
              :rule-set ("hr-resolve-special"))

which says that the sorting should be done in the following order: first
rules for sanskrit diacriticits, then alphabetic sort of Croatian (hr)
characters etc. followed by another set of rules saying to sort Croatian
diacritics (I was using latin2 encoding) etc.

Here is example of resolve-sanskrit-diacritics:

(define-rule-set "resolve-sanskrit-diacritics"

   :rules  (("\\={(a)}" "\1" :bregexp :again)
            ("\\={\\i}" "i" :bregexp :again)
            ("\\={I}" "I" :bregexp :again)
            ("\\\.{(.)}" "\1" :bregexp :again)
            ("\\d{(r)}" "ri" :bregexp :again)
            ("\\d{(t)}" "\1" :bregexp :again)
            ("\\d{(T)}" "\1" :bregexp :again)
            ("\\d{(d)}" "\1" :bregexp :again)
            ("\\d{(n)}" "\1" :bregexp :again)
            ("\\d{(s)}" "š" :bregexp :again)
            ("\\d{(S)}" "Š" :bregexp :again)
            ("\\~{(.)}" "\1" :bregexp :again)
            ("\\'{(c)}" "ć" :bregexp :again)
            ("\\'{(C)}" "Ć." :bregexp :again)
            ("\\'{(s)}" "š" :bregexp :again)
            ("\\'{(S)}" "Š" :bregexp :again)

which says that e.g. 'ṣ' which is pronounced similar to Croatian 'š'
should go in the same letter-group, same with 'Ś' which goes to 'Š'. 'ṛ'
is pronounced as 'ri' and it should goes in the letter group 'ri' etc.

Of course, at that time, without proper Unicode support, it was a bit
cumbersome but I was able to see everything properly in LyX as well as
properly sorted in the final PDF/PS outputs.

Is something like that possible in ConTeXt?


The working senses are superior to dull matter; mind is higher 
than the senses; intelligence is still higher than the mind; 
and he [the soul] is even higher than the intelligence.

More information about the ntg-context mailing list