GATE - JAPE规则嵌套'包含'运算符 - 正确的语法

时间:2018-05-15 08:40:16

标签: syntax nlp grammar gate

当我尝试使用OR运算符创建'Sentence contains'jape规则时,即当句子包含1 OR 2 AND 3 OR 4时,我遇到错误:

(
   { 
      Sentence contains { Annotation1 | Annotation2 },  
      Sentence contains { Annotation3 | Annotation4 }
   }
)  
:temp  
--> 

有人可以建议正确的语法吗?

1 个答案:

答案 0 :(得分:3)

在LSH jape语法中没有类似AND运算符的东西,我们不能在上下文运算符中使用OR运算符,即;包含和内部。相反,你可以像这样编码。

(
    ({Sentence contains {Annotation1}} | {Sentence contains {Annotation2}})
    ({Sentence contains {Annotation3}} | {Sentence contains {Annotation4}})
)
:temp
-->
相关问题