FJ1993
FJ1993

Reputation: 115

GATE - JAPE rule nested ‘contains’ operators - correct syntax

I am getting errors when I try to create ‘Sentence contains’ jape rules with OR operators, i.e when a Sentence contains 1 OR 2 AND 3 OR 4:

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

Can someone please advise on the correct syntax?

Upvotes: 1

Views: 270

Answers (1)

Aniz
Aniz

Reputation: 131

There is no such thing like AND operator in LSH jape grammar and we cannot use OR operator inside contextual operators ie; contains and within. Instead you can code like this.

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

Upvotes: 3

Related Questions