On 2013-12-06 10:46, Richard Eckart de Castilho wrote:
Hi,
assuming I have a Ruta script with recurring statements of the type
PartOfSpeech{FEATURE("value", "N")
Is it possible to define some kind of macro to replace this long
statement with a short-hand?
MACRO N := PartOfSpeech{FEATURE("value", "N")}
MACRO V := PartOfSpeech{FEATURE("value", "V")}
N{0,2} V
From what I know, RUTA does not support macro yet.
The closest thing I found in Ruta for such a thing was a Block - but
doesn't seem to do what I want, because I would need to ->CALL it.
I would define temporary annotations for N and V. The compromise on
performance is not the same though. It consumes more memory, but
searching for N or V does not require to scan all part-of-speeches
annotations anymore.
Hope this help,
Alexandre
--
Alexandre Patry, Ph.D
Chercheur / Researcher
http://KeaText.com