Re: [NTG-context] czech sorting in MiIV

2010-05-16 Thread Tomáš Pustelník

--
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

2010-05-15 Thread Aditya Mahajan

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

2010-05-15 Thread Tomáš Pustelník

--
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

2010-05-15 Thread Hans Hagen

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

2010-05-15 Thread Tomáš Pustelník



--
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

2010-05-15 Thread Hans Hagen

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
___