Re: [NTG-context] czech sorting
On 17-5-2010 10:31, Tomáš Pustelník wrote: Hi, again czech sorting in MkIV is little wrong, I found it out coincidentally, when I was testing it. Order of character with accent is strange. Look at the file in attachment. Is there some way how to set order in which groups are supposed to be sorted, like in MkII? Also I really wonder why letter R is not included in sorting. groups? can you check the czech vector in sort-lan.lua? - 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 - ___ 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 ___
[NTG-context] czech sorting
Hi, again czech sorting in MkIV is little wrong, I found it out coincidentally, when I was testing it. Order of character with accent is strange. Look at the file in attachment. Is there some way how to set order in which groups are supposed to be sorted, like in MkII? Also I really wonder why letter R is not included in sorting. Tomas P. cz-sort.pdf Description: Adobe PDF document cz-sort.tex Description: Binary data ___ 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 ___
Re: [NTG-context] czech sorting in MiIV
-- From: "Aditya Mahajan" Sent: Sunday, May 16, 2010 5:08 AM To: "mailing list for ConTeXt users" Subject: Re: [NTG-context] czech sorting in MiIV Also I have question. In my bachelor thesis I'm describe language support for ConTeXt and when I tried add some experimental language into ConTeXt (I define system constants and add \loadcorefile{lang-exp} to context.mkii and context.mkiv) and when generating format for MkII everything was ok but for MkIV ConTeXt complained he can't find file lang-exp.tex (I paste it in base folder to other source codes). Any idea whats wrong? In MkIV must I change something else as well? Did you run luatools --generate. Aditya Thanks, I forgot about this. It's working now ___ 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 ___
Re: [NTG-context] czech sorting in MiIV
On Sat, 15 May 2010, Tomáš Pustelník wrote: On 15-5-2010 7:10, Tomáš Pustelník wrote: > I'm using version 2010.05.13 12:15 so if there isn't some special way > how to download beta I should be using lates version. Also in MkIV I set > sorting with this command? normally the garden is a few hours behind the website you can fetch the beta from the website and unzip it in texmf-context and then run luatools --generate > \enabletrackers[sorters.tests] just tracking Thanks, it's working now, but still it sort some words bit different compared to MkII. But it's ok for now, I will check czech norm and try to fix it if needed. Also I have question. In my bachelor thesis I'm describe language support for ConTeXt and when I tried add some experimental language into ConTeXt (I define system constants and add \loadcorefile{lang-exp} to context.mkii and context.mkiv) and when generating format for MkII everything was ok but for MkIV ConTeXt complained he can't find file lang-exp.tex (I paste it in base folder to other source codes). Any idea whats wrong? In MkIV must I change something else as well? Did you run luatools --generate. Aditya___ 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 ___
Re: [NTG-context] czech sorting in MiIV
-- From: "Hans Hagen" Sent: Saturday, May 15, 2010 9:42 PM To: "mailing list for ConTeXt users" Cc: "Tomáš Pustelník" Subject: Re: [NTG-context] czech sorting in MiIV On 15-5-2010 8:14, Tomáš Pustelník wrote: Also I have question. In my bachelor thesis I'm describe language support for ConTeXt and when I tried add some experimental language into ConTeXt (I define system constants and add \loadcorefile{lang-exp} to context.mkii and context.mkiv) and when generating format for MkII everything was ok but for MkIV ConTeXt complained he can't find file lang-exp.tex (I paste it in base folder to other source codes). Any idea whats wrong? In MkIV must I change something else as well? Ah .. you look in the wrong spot. There's a file: mult-def.lua and interfaces are defined there. I generate the mult-* files using mtxrun interface --context Now, if you just want to experiment, you need to patch mult-def.lua. You can make a mult-def-mine.lua: local t = require "mult-def.lua" t.commands.framed.xx = "frmd" -- print(table.serialize(t.commands.framed)) return t I patched mtx-interface.lua so that you can say; mtxrun interface --context mult-def-mine.lua There is also --messages for the message files. Of course you have to make a cont-xx.tex file as well. Hans Thank you, this will be handy (actually I was planing to ask about user interface as well). But what I had in mind was new language definition (like lang-sla, lang-ger and so on), perhaps I could be more precise. But anyway, thanks. As I said, I will use this as well. Tomas P. ___ 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 ___
Re: [NTG-context] czech sorting in MiIV
On 15-5-2010 8:14, Tomáš Pustelník wrote: Thanks, it's working now, but still it sort some words bit different compared to MkII. But it's ok for now, I will check czech norm and try to fix it if needed. we can support several norms if needed Also I have question. In my bachelor thesis I'm describe language support for ConTeXt and when I tried add some experimental language into ConTeXt (I define system constants and add \loadcorefile{lang-exp} to context.mkii and context.mkiv) and when generating format for MkII everything was ok but for MkIV ConTeXt complained he can't find file lang-exp.tex (I paste it in base folder to other source codes). Any idea whats wrong? In MkIV must I change something else as well? Ah .. you look in the wrong spot. There's a file: mult-def.lua and interfaces are defined there. I generate the mult-* files using mtxrun interface --context Now, if you just want to experiment, you need to patch mult-def.lua. You can make a mult-def-mine.lua: local t = require "mult-def.lua" t.commands.framed.xx = "frmd" -- print(table.serialize(t.commands.framed)) return t I patched mtx-interface.lua so that you can say; mtxrun interface --context mult-def-mine.lua There is also --messages for the message files. Of course you have to make a cont-xx.tex file 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 - if not modules then modules = { } end modules ['mtx-cache'] = { version = 1.001, comment = "companion to mtxrun.lua", author= "Hans Hagen, PRAGMA-ADE, Hasselt NL", copyright = "PRAGMA ADE / ConTeXt Development Team", license = "see context related readme files" } local format = string.format scripts = scripts or { } scripts.interface = scripts.interface or { } local flushers = { } local userinterfaces= { 'en','cs','de','it','nl','ro','fr','pe' } local messageinterfaces = { 'en','cs','de','it','nl','ro','fr','pe','no' } function flushers.scite(interface,collection) local result, i = {}, 0 result[#result+1] = format("keywordclass.macros.context.%s=",interface) for _, command in ipairs(collection) do if i==0 then result[#result+1] = "\\\n" i = 5 else i = i - 1 end result[#result+1] = format("%s ",command) end io.savedata(format("cont-%s-scite.properties",interface), table.concat(result),"\n") io.savedata(format("cont-%s-scite.lua",interface), table.serialize(collection,true)) end function flushers.jedit(interface,collection) local result = {} result[#result+1] = "" result[#result+1] = "\n" result[#result+1] = "" result[#result+1] = "\t" result[#result+1] = "\t\t" for _, command in ipairs(collection) do result[#result+1] = format("\t\t\t%s",command) end result[#result+1] = "\t\t" result[#result+1] = "\t" result[#result+1] = "" io.savedata(format("context-jedit-%s.xml",interface), table.concat(result),"\n") end function flushers.bbedit(interface,collection) local result = {} result[#result+1] = "" result[#result+1] = "BBLMKeywordList" result[#result+1] = "" for _, command in ipairs(collection) do result[#result+1] = format("\t\\%s",command) end result[#result+1] = "" io.savedata(format("context-bbedit-%s.xml",interface), table.concat(result),"\n") end function flushers.raw(interface,collection) for _, command in ipairs(collection) do logs.simple(command) end end function scripts.interface.editor(editor) local interfaces= environment.files if #interfaces == 0 then interfaces= userinterfaces end local xmlfile = resolvers.find_file("cont-en.xml") or "" if xmlfile == "" then logs.simple("unable to locate cont-en.xml") end for _, interface in ipairs(interfaces) do local keyfile = resolvers.find_file(format("keys-%s.xml",interface)) or "" if keyfile == "" then logs.simple("unable to locate keys-*.xml") else local collection = { } local mappings = { } local x = xml.load(keyfile) for e, d, k in xml.elements(x,"cd:command") do local at = d[k].at local name, value = at.name, at.value if name and value then mappings[name] = value end end local x = xml.load(xmlfile) for e, d, k in xml.elements(x,"cd:command") do local at = d[k].at local name, type = at.name, at["type"]
Re: [NTG-context] czech sorting in MiIV
-- From: "Hans Hagen" Sent: Saturday, May 15, 2010 7:26 PM To: "Tomáš Pustelník" Subject: Re: [NTG-context] czech sorting in MiIV On 15-5-2010 7:10, Tomáš Pustelník wrote: I'm using version 2010.05.13 12:15 so if there isn't some special way how to download beta I should be using lates version. Also in MkIV I set sorting with this command? normally the garden is a few hours behind the website you can fetch the beta from the website and unzip it in texmf-context and then run luatools --generate \enabletrackers[sorters.tests] just tracking Thanks, it's working now, but still it sort some words bit different compared to MkII. But it's ok for now, I will check czech norm and try to fix it if needed. Also I have question. In my bachelor thesis I'm describe language support for ConTeXt and when I tried add some experimental language into ConTeXt (I define system constants and add \loadcorefile{lang-exp} to context.mkii and context.mkiv) and when generating format for MkII everything was ok but for MkIV ConTeXt complained he can't find file lang-exp.tex (I paste it in base folder to other source codes). Any idea whats wrong? In MkIV must I change something else as well? Tomas P. ___ 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 ___
Re: [NTG-context] czech sorting in MiIV
On 15-5-2010 2:49, Tomáš Pustelník wrote: Hi, is czech sorting in MkIV working? When I tried it with this code: \mainlanguage[cz] \enableregime [utf-8] \starttext \setupregister[index][language=cz] \index{chobot}chobot \index{áro}áro \index{akát}akát \index{Áčko}Áčko \index{astma}astma \index{ámerika}ámerika \index{arábie}arábie \index{Árun}Árun \index{žába}žába \index{cibule}cibule \index{čára}čára \index{bomba}bomba \index{Auto}Auto \index{arek}arek \placeindex \stoptext ConTeXt sorted only letters without accent and rest of the words just put before index without any kind of sorting, also accented characters inside words are sorted wrong way. Is it just me or the sorting is really broken? Is there some text how to do sorting in MkIV so I can fix it, or I just need to follow rest of the sort-lan.lua to write sorting rules? sort-lan.lua ... what is the sort order you expect? Also in MkII what commands \exportsortreduction and \exportsortshortcut do? I couldn't figured it out from source codes. they are methods for influencing the sort order (they write some info to the tui/tuio file that is used later on) 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 - ___ 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 ___
[NTG-context] czech sorting in MiIV
Hi, is czech sorting in MkIV working? When I tried it with this code: \mainlanguage[cz] \enableregime [utf-8] \starttext \setupregister[index][language=cz] \index{chobot}chobot \index{áro}áro \index{akát}akát \index{Áčko}Áčko \index{astma}astma \index{ámerika}ámerika \index{arábie}arábie \index{Árun}Árun \index{žába}žába \index{cibule}cibule \index{čára}čára \index{bomba}bomba \index{Auto}Auto \index{arek}arek \placeindex \stoptext ConTeXt sorted only letters without accent and rest of the words just put before index without any kind of sorting, also accented characters inside words are sorted wrong way. Is it just me or the sorting is really broken? Is there some text how to do sorting in MkIV so I can fix it, or I just need to follow rest of the sort-lan.lua to write sorting rules? Also in MkII what commands \exportsortreduction and \exportsortshortcut do? I couldn't figured it out from source codes. Thanks Tomas Pustelnik___ 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 ___
[NTG-context] Czech sorting
Hello Hans,I've prepared and tested the complete sorting rules for Czech. Could you please put them into sort-lan.tex?The rules are quite simple: - all accented letter shall follow the unaccented ones- "caron" letters (consonants) are placed into separate groups- "acute" and "ring" letters (wowels) are placed under the appropriate unaccented lettersBut I vitally need to fix the problem that the sorting doesn't work when using \setupregister[index][expansion=xml]otherwise it's still useless for me... :-(Many thanx,Richard--\def\czsortdivisionch{ch}\def\czsortdivisionCh{Ch}\startmode[sortorder-cz] \exportsortexpansion{aacute}{a+1} \exportsortexpansion{Aacute}{A+1} \exportsortexpansion{ccaron}{c+1} \exportsortexpansion{Ccaron}{C+1} \exportsortdivision{c+1}{ccaron} \exportsortexpansion{dcaron}{d+1} \exportsortexpansion{Dcaron}{C+1} \exportsortdivision{d+1}{dcaron} \exportsortexpansion{eacute}{e+1} \exportsortexpansion{Eacute}{E+1} \exportsortexpansion{ecaron}{e+2} \exportsortexpansion{Ecaron}{E+2} \exportsortreduction{ch}{h+1} \exportsortexpansion{ch}{h+1} \exportsortreduction{Ch}{h+1} \exportsortexpansion{Ch}{h+1} \exportsortdivision{h+1}{czsortdivisionch} \exportsortexpansion{iacute}{i+1} \exportsortexpansion{Iacute}{I+1} \exportsortexpansion{ncaron}{n+1} \exportsortexpansion{Ncaron}{n+1} \exportsortdivision{n+1}{ncaron} \exportsortexpansion{oacute}{o+1} \exportsortexpansion{Oacute}{O+1} \exportsortexpansion{rcaron}{r+1} \exportsortexpansion{Rcaron}{R+1} \exportsortdivision{r+1}{rcaron} \exportsortexpansion{scaron}{s+1} \exportsortexpansion{Scaron}{S+1} \exportsortdivision{s+1}{scaron} \exportsortexpansion{tcaron}{t+1} \exportsortexpansion{Tcaron}{T+1} \exportsortdivision{t+1}{tcaron} \exportsortexpansion{uacute}{u+1} \exportsortexpansion{Uacute}{U+1} \exportsortexpansion{uring}{u+2} \exportsortexpansion{Uring}{U+2} \exportsortexpansion{yacute}{y+1} \exportsortexpansion{Yacute}{Y+1} \exportsortexpansion{zcaron}{z+1} \exportsortexpansion{Zcaron}{Z+1} \exportsortdivision{z+1}{zcaron}\stopmode___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
[NTG-context] Czech sorting rules
Hello, I've tried to find something relevant about the terrible Czech sorting :-) The first thing to note is that there is a standard (from 1970 or so) that is not implementable in fact, it requires such stupid sorts like Karel IV < Karel III as one should sort it as the numbers were written in words (ctvrty, treti) :-) So in practice, there are more-or-less accurate approximations. Quite good intro is http://www.vitsoft.info/sortkit.htm The sorting is considered very reasonable if it conforms with order stated in http://www.fi.muni.cz/~adelton/l10n/cssort/cssort.table . Characters on a single line in the table are considered equivalent. Note the `ch' character that is sorted between h and i. This table contains accented letters that are not used in Czech (like crossed l, z dot above). It should IMHO be also completely OK for Slovak (as they, I hope, inherited the standard). I think that it would be completely OK to sort according to that table taking chars on single lines as equivalent. The modules the table is from implements a four-pass sorting algorithm that reflects pretty damn rules, see http://www.fi.muni.cz/~adelton/l10n/cssort/csort.c . An example of sorted sequences is http://www.fi.muni.cz/~adelton/l10n/cssort/sort.tab . The question is if it is reasonable to implement it internally in ConTeXt or to use an external module. An external Perl module was prepared by Tom Hudec once (he even modified the sorting table, he preferred all letters with `hacek (\v{})' to be greater than without \v. If you consider internal ConTeXt implementation feasible, I'd be happy if you commented the sorting macros a bit, so that I could contact native Czech users and fine-tune it. I'd like to consult it with our Czech TeX frieds, I don't feel myself to be a sorting expert (it's quite tricky, isn't it). Thanks, D.A. -- Early to rise, early to bed, makes a man healthy, wealthy and dead. -- Terry Pratchett, "The Light Fantastic" ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context