I need to annotate a part of a sentence if the words i have written in my jape rule appear in the same sentence. Eg the sentence is "The child cannot resist any changes to his routine". I have put words like resist in "trouble.lst" file and changes in "alteration.lst" file. Now in this sentence i need to annotate the part "resist any changes" as "A3b". I have tried using the below code but it is not considering words in the same sentence. My jape rule is taking words from different sentences as well. Suppose resist comes in one sentence and changes in some other later sentence, so this code is annotating that as well. Can anyone please help me out figure out solution to this?
Phase:secondpass
Input: Lookup
Options: control = brill
Rule: A3b
({Lookup.majorType == "trouble"}
{Lookup.majorType == "alteration"}
):label
-->
:label.A3b = {rule= "A3b"}
See Question&Answers more detail:os