Re: [NTG-context] checking the first word in a command

2015-01-27 Thread Pablo Rodriguez
On 01/26/2015 10:26 PM, Hans Hagen wrote: On 1/26/2015 10:04 PM, Pablo Rodriguez wrote: [...] How can I specify that the replacer takes not only strings but complete words? local replacer = lpeg.replacer { { señora, la señora }, { señor, el señor }, } Many thanks

Re: [NTG-context] checking the first word in a command

2015-01-26 Thread Otared Kavian
Hi Hans, Nice code Hans!… But somehow your replacer code gives always « el » even in front of « señora »… It seems that your lua code for replacer sees « señor » and does not check whether it is « señora » or not. If one modifies a little bit the code into the following, the issue is solved:

[NTG-context] checking the first word in a command

2015-01-26 Thread Pablo Rodriguez
Dear list, I have the following sample: \starttext \def\Persona{señor Juan Martínez} \def\Persona{señora María Pérez} El/La \Persona\ ha aprobado. \stoptext How can I replace El/La in text with a command that can assign the proper article? I could use the translate

Re: [NTG-context] checking the first word in a command

2015-01-26 Thread Hans Hagen
On 1/26/2015 5:49 PM, Pablo Rodriguez wrote: Dear list, I have the following sample: \starttext \def\Persona{señor Juan Martínez} \def\Persona{señora María Pérez} El/La \Persona\ ha aprobado. \stoptext How can I replace El/La in text with a command that can assign

Re: [NTG-context] checking the first word in a command

2015-01-26 Thread Hans Hagen
On 1/26/2015 10:04 PM, Pablo Rodriguez wrote: On 01/26/2015 09:24 PM, Otared Kavian wrote: Hi Hans, Nice code Hans!… But somehow your replacer code gives always « el » even in front of « señora »… It seems that your lua code for replacer sees « señor » and does not check whether it is «

Re: [NTG-context] checking the first word in a command

2015-01-26 Thread Pablo Rodriguez
On 01/26/2015 09:24 PM, Otared Kavian wrote: Hi Hans, Nice code Hans!… But somehow your replacer code gives always « el » even in front of « señora »… It seems that your lua code for replacer sees « señor » and does not check whether it is « señora » or not. If one modifies a little bit