[NTG-context] index for Japanese alphabet

S Barmeier severinbarmeier at googlemail.com
Mon Apr 9 13:26:45 CEST 2012


On 04/08/2012 12:03 AM, Hans Hagen wrote:
> On 2-4-2012 11:01, S Barmeier wrote:
>> Hi,
>>
>> I would like to include an index with Japanese terms, ordered according
>> to the Japanese alphabet.
>>
>> I can say \index[kanji]{漢字} for an entry under K. For my Japanese
>> index I imagine \index[かんじ]{漢字} to place an entry under か. Is
>> something like this possible?
>>
>> The Japanese alphabet fits (almost) into a 5x10 table. Depending on the
>> size of the index, it is customary to order an index either by column
>> only (for a smaller index) or by table entry (top-to-bottom,
>> right-to-left). I'd be happy with either, although the smaller one will
>> probably suffice for my purposes...
>>
>> Any help on how to implement this?
> 
> All that is needed is information ... you can have a look in the
> sort-lan.* files. I also suggest that you check with Dalyoung
> (haksan at me.com) as he keeps an eye on cjk issues. For instance korean
> sorting is supported, so japanese should ne possible as well.
> 
> Hans
> 
> 
> 
> -----------------------------------------------------------------
>                                           Hans Hagen | PRAGMA ADE
>               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
>                                              | www.pragma-pod.nl
> -----------------------------------------------------------------

The ordering would be ka-i ga-i ka-n ga-n
The rule "i before n" is stronger than the rule "ka before ga". I guess
this is the same in, say, German, where 'essen' should come before
'Essen', but 'Essbarkeiten' before both of them, "e before E" being the
weakest ordering rule...

Is this the use of

local cs,  CS  = utfchar(replacementoffset + 1),
utfchar(replacementoffset + 11)

in sort-lan.lua?

Once I know how to enable a particular sorting pattern for a register I
can probably figure it out by myself. How would I do that?

Best,
Severin

--- Japanese

definitions["jp"] = {
    replacements = {
        { "ぁ", "あ" }, { "ぃ", "い" },
        { "ぅ", "う" }, { "ぇ", "え" },
        { "ぉ", "お" }, { "っ", "つ" },
        { "ゃ", "や" }, { "ゅ", "ゆ" },
        { "ょ", "よ" },
    },
    entries = {
        ["あ"] = "あ", ["い"] = "い", ["う"] = "う", ["え"] = "え", ["
お"] = "お",
        ["か"] = "か", ["き"] = "き", ["く"] = "く", ["け"] = "け", ["
こ"] = "こ",
        ["さ"] = "さ", ["し"] = "し", ["す"] = "す", ["せ"] = "せ", ["
そ"] = "そ",
        ["た"] = "た", ["ち"] = "ち", ["つ"] = "つ", ["て"] = "て", ["
と"] = "と",
        ["な"] = "な", ["に"] = "に", ["ぬ"] = "ぬ", ["ね"] = "ね", ["
の"] = "の",
        ["は"] = "は", ["ひ"] = "ひ", ["ふ"] = "ふ", ["へ"] = "へ", ["
ほ"] = "ほ",
        ["ま"] = "ま", ["み"] = "み", ["む"] = "む", ["め"] = "め", ["
も"] = "も",
        ["や"] = "や", ["ゆ"] = "ゆ", ["よ"] = "よ",
        ["ら"] = "ら", ["り"] = "り", ["る"] = "る", ["れ"] = "れ", ["
ろ"] = "ろ",
        ["わ"] = "わ", ["ゐ"] = "ゐ", ["ゑ"] = "ゑ", ["を"] = "を", ["
ん"] = "ん",
    },
    orders = {
        "あ", "い", "う", "え", "お", "か", "き", "く", "け", "こ",
        "さ", "し", "す", "せ", "そ", "た", "ち", "つ", "て", "と",
        "な", "に", "ぬ", "ね", "の", "は", "ひ", "ふ", "へ", "ほ",
        "ま", "み", "む", "め", "も", "や", "ゆ", "よ",
        "ら", "り", "る", "れ", "ろ", "わ", "ゐ", "ゑ", "を", "ん",
    }
}


More information about the ntg-context mailing list