新しい処理リソースを初期化した Java コードで Author (From author,jape) に注釈を付ける独自のルールを作成しようとしています。コードは正常に実行されますが、ma に注釈を付けません。著者として注釈を付け、書籍の名前を一時変数に保存する必要があります。私のJavaコード:
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());
出力では、トークン、スペーストークンのみを提供します誰でも問題を解決するのを手伝ってくれますか?