Replies: 1 comment 11 replies
-
There could be several reasons for this. If any of the annotations of type "type2" starts at the same offset as some other annotation (e.g. a "Token"), it will only match if it is the actual next annotation in the annotation sequence (in gatenlp, other than Java GATE, annotations starting at the same offset are still ordered by annotation id). In order to match any or all annotation at the next offset, try to use "AnnAt" instead of "Ann". You should not need the These parameters are only needed when a pattern can be matched in many different combinations and ways and one needs to find the shortest, longest or all of these combinations. please check what |
Beta Was this translation helpful? Give feedback.
-
p = Seq(Ann(name="tok1", type="type1"),N(Ann(name="tok2", type="type2"), min=1, max=10, matchtype='all', select='all'))
a = AddAnn(name="tok2", anntype="type3")
r = Rule(p,a)
anns2match = doc2.annset("Resume").with_type("type1","type2")
outset = doc.annset("new")
outset.clear()
Pampac(r).run(doc, anns2match, outset=outset)
I try to catch all the 1 to 10 Tokens of "type2" that are placed after the token of "type1" and before the next "type1". But my code only annotates the first token of "type2" as "type3" and not the next ones.
Would you please help?
Beta Was this translation helpful? Give feedback.
All reactions