DECLARE A,B;
DECLARE Annotation C(Annotation firstA, Annotation secondA,...);
"token1|token2|...|tokenn" -> A;
"token3|token4" -> B;
A A B {->MARK(C,1,3)};
我用 GATHER 做过
(A COMMA A B) {-> GATHER(C,1,4,"firstA"=1,"secondA" = 3,"B"=4)};
但是如果是 A 类型的未知序列呢?如下所示,如何将所有 A 存储在特征中?特征的数量也是未知的。在plan java中,我们声明String数组并可以添加元素,但在Ruta中似乎没有这样的过程。
(A (COMMA A)+ B) {-PARTOF(C) -> GATHER(C,beginPosition,endPosition,"firstA"=1,"secondA" = 3,"thirdA"=?,so on)};