I am trying to write my own rule that annotates Author (From author,jape) in my java code i have initialized my new processing resource.The code runs fine but does not annotates ma text: input: who is the author of xyz output: it should get annotated as author and shd save the name of book in some temporary variable. my java code:
Gate.init();
Gate.getCreoleRegister().registerDirectories(
new File(Gate.getPluginsHome(), "ANNIE").toURI().toURL());
SerialAnalyserController pipeline =
(SerialAnalyserController)gate.Factory.createResource(
"gate.creole.SerialAnalyserController");
LanguageAnalyser tokeniser = (LanguageAnalyser)gate.Factory.createResource(
"gate.creole.tokeniser.DefaultTokeniser");
LanguageAnalyser jape = (LanguageAnalyser)gate.Factory.createResource(
"gate.creole.Transducer", gate.Utils.featureMap(
"grammarURL", new File("E:\\GATE_Developer_7.1\\plugins\\ANNIE\\resources\\NE\\Author.jape").toURI().toURL(),
"encoding", "UTF-8"));
pipeline.add(tokeniser);
pipeline.add(jape);
Corpus corpus = gate.Factory.newCorpus(null);
Document doc = gate.Factory.newDocument("Who is author of Inception");
DocumentContent dc=doc.getContent();
corpus.add(doc);
pipeline.setCorpus(corpus);
pipeline.execute();
System.out.println("Found annotations of the following types: " +
doc.getAnnotations().getAllTypes());
in output it only gives token,space token Can anyone help me to workout the problem.?