Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6356471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:58:09+00:00 2026-05-24T22:58:09+00:00

Hello I have been trying to work on information retrieval for quite sometime and

  • 0

Hello I have been trying to work on information retrieval for quite sometime and have been facing some difficulties.
Recently I downloaded StandAloneAnnie.java from following link

http://gate.ac.uk/wiki/code-repository/src/sheffield/examples/StandAloneAnnie.java
Though I have been able to execute it and see the output I have a query or two.

  1. This program annotates people and locations, where is the grammar stored for annotating such entities.

  2. How can I write my own simple grammar to extract some data and use it in my copy of StandAloneAnnie.java?

Previous posts
Hundreds of RegEx on one string New to NLP, Question about annotation

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T22:58:10+00:00Added an answer on May 24, 2026 at 10:58 pm

    Following is a simple grammar for tagging Height of a person

    Phase: Meaurements
    Input: Token Number 
    Options: control=appelt debug=true
    
    
    
    Rule: Height
    (
    ({Number})
    ( {Token.string=~"[Ff]t"} | {Token.string=~"[Ii]n"} | {Token.string=~"[Cc]m"})
    ):height
    -->
    :height.Height= {value= :height.Number.value, unit= :height.Token.string}
    

    This is the main code that gets executed,

        public static void main(String arg[]) {
    
                Gate.init();
                gate.Corpus corpus= (Corpus) Factory.createResource("gate.corpora.CorpusImpl");
    
    //You need to register the plugin before you load it.
    
                Gate.getCreoleRegister().registerDirectories(new File(Gate.getPluginsHome(), ANNIEConstants.PLUGIN_DIR).toURI().toURL());
                Gate.getCreoleRegister().registerDirectories(new URL("file:///GATE_HOME/plugins/Tagger_Numbers"));//change this path
    
    
                Document doc = new DocumentImpl();
    //The string to be annotated.
    
    String str = "Height is 60 in. Weight is 150 lbs pulse rate 90 Pulse rate 90";
    DocumentContentImpl impl = new DocumentContentImpl(str);
    doc.setContent(impl);
    
    //Loading processing resources. refer http://gate.ac.uk/gate/doc/plugins.html for what class the plugin belongs to
    
                ProcessingResource token = (ProcessingResource) Factory.createResource("gate.creole.tokeniser.DefaultTokeniser", Factory.newFeatureMap());
                ProcessingResource sspliter = (ProcessingResource) Factory.createResource("gate.creole.splitter.SentenceSplitter", Factory.newFeatureMap());
                ProcessingResource number = (ProcessingResource) Factory.createResource("gate.creole.numbers.NumbersTagger", Factory.newFeatureMap());
    
    
    /*pipeline is an application that needs to be created to use resources loaded above.
    Reasources must be added in a particular order eg. below the 'number' resource requires the document to be tokenised. */
    
    corpus.add(doc);
    SerialAnalyserController pipeline = (SerialAnalyserController) Factory.createResource("gate.creole.SerialAnalyserController", Factory.newFeatureMap(), Factory.newFeatureMap(), "ANNIE");
    pipeline.setCorpus(corpus);
    pipeline.add(token);
    pipeline.add(sspliter);
    pipeline.add(number);
    pipeline.execute();
    
    //Extract info from an annotated document.
    
    AnnotationSetImpl ann=(AnnotationSetImpl)doc.getAnnotations();
    Iterator<Annotation>i = ann.get(vital).iterator();
    Annotation annotation = i.next();
    long start = annotation.getStartNode().getOffset();
    long end =  annotation.getEndNode().getOffset();
    System.out.println(doc.toString().substring((int)start, (int)end));
    
    }
    

    Note:-
    In the above code, the grammar for Height will be written in a .jape file. You need to run this grammar using a JAPE(JAPE Plus) transducer. We just need to execute the application(‘pipeline’) in our main code. You can find tutorial for writing jape at gate.ac.uk/sale/tao

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hell All, So I have been facing this behavior for quite some time and
Hello I have been trying to make this form work with no luck, So
Hello I am trying to bind my work space and I have been doing
Hello I have been trying to send an email in magento with out a
Hello guys, I have been trying to implement the DSUM function but failed to
Hello fellow developers! Recently I've been playing with Rails 3.0 and after quite a
I have been trying all day to get app-engine sdk to work nothing has
So I have been trying for hours to get this to work and I
Hi I have been trying to learn how to add some accessibility tools but
Hello I am trying to read my xml document using xpath. I have been

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.