1

I am just a beginner in GATE. I am reading the GATE tutorial module 3 to better understand JAPE(https://gate.ac.uk/sale/talks/gate-course-may10/track-1/module-3-jape/module-3-jape.pdf). However, I met a confusing problem that can't be solved. Looking for help. Thanks a lot!

============================================================

The context I am dealing with(just a simple sentence):

We love coming to the University of Sheffield. The weather is always beautiful here.

The JAPE I am using:

Phase: University
Input: Token Lookup SpaceToken
Options: control = appelt


Rule: University1 
(
 {Token.string == "University"} 
 {Token.string == "of"}
 ({Lookup.minorType == city}):cityName 
):orgName 
-->
:orgName.UniversityTown = {kind = :orgName.Lookup.majorType}

However, it doesn't work at all. Firstly, I loaded the ANNIE and then I run the JAPE but nothing happened, even a Error Warnning.

But when I change the 'string' to something like a annotation(crerated by ANNIE), the JAPE works.

Thus I am very confusing that whether the JAPE rule can direclty read the string in the context. If someone could give me some information related, I will be very grateful.

Hope to get the answer soon.

Fan Yang
  • 23
  • 3

1 Answers1

0

The problem here is in "Input: Token Lookup SpaceToken" line. You have added a SpaceToken which prevented content matching.

There are two options:

a) Remove SpaceToken from Input

b) Modify your JAPE rule to:

{Token.string == "University"}
{SpaceToken}
{Token.string == "of"}
{SpaceToken}
({Lookup.minorType == city}):cityName
ashingel
  • 494
  • 3
  • 11
  • Thank you ashingel. It wroks. But I still have a similar problem. I have a context like the following: **JetBlue | Mint: JetBlue's refreshing take on a premium experience: http://t.co/M6PDylpd8I This is awesome!! 1** The number 1 is makred as annotation 'polarity' and I have the following code to add some feature: `Phase: Positivecomment Input: Polarity Options: control = appelt Rule: pcomment ( {Polarity.string=="1"} ): test_1 --> :test_1.attitude = {rule=positive}` However, it doesn't work either. Do you know what's wrong with the code above? – Fan Yang Mar 20 '16 at 13:12
  • Could you please confirm that Polarity annotation has a feature named "string" with value 1 in this example? – ashingel Mar 21 '16 at 06:29
  • Ok, I understand. It's a string feature, not a real 'string'. Anyway, thanks a lot! – Fan Yang Mar 21 '16 at 10:03