[NTG-context] Sorting registers method for "uppercase like lowercase, diacritics ignored"

Thomas A. Schmitz thomas.schmitz at uni-bonn.de
Sun Jan 20 23:02:52 CET 2019


On 20.01.19 21:59, Marcus Vinicius Mesquita wrote:
> Well, I tried all possible permutations thereof, and also the predefined
> methods, and none gives what my editor wants, which is just "uppercase like
> lowercase, diacritics ignored".
> See MWE attached.
> Please, would somebody help me achieve the desired result?

Your example doesn't contain any uppercase letters. Which makes it a bit 
difficult to test what you're looking for. I must admit that I'm not 
very familiar with register "methods," I assume that Wolfgang or Hans 
will be able to tell you how to use them. For your case, if you merely 
want to get rid of all distinctions between upper- and lowercase, 
accents, etc., you could use
Lua (slightly modified example):

\mainlanguage[pt]
\defineregister [nome]
\setupregister  [nome] [
       language=pt,
       n=1,
]

\startluacode
   userdata = userdata or { }
   function userdata.indexing(s)
     t = characters.lower(characters.shaped(s))
     context.nome( { t }, s)
   end
\stopluacode

\def\mynome#1%
   {\ctxlua{userdata.indexing([==[#1]==])}}

\starttext

\mynome{árvore}árvore \mynome{Äard}Äard \mynome{água}água 
\mynome{Água}Água  \mynome{abnegação}abnegação \mynome{alegria}alegria 
\mynome{agrilhoado}agrilhoado \mynome{anjo}anjo \mynome{ódio}ódio 
\mynome{orgulho}orgulho \mynome{Åz}Åz \mynome{Åaaa}Åaaa \mynome{Özz}Özz 
\mynome{Öaa}Öaa

\page[yes]

\placeregister [nome]

\stoptext


More information about the ntg-context mailing list