PAX Problem in Gate Api
Hi Gate,
I am writing a simple code for extracting predicate and arguments structures using MultiPaX(plugIn).
I have tried to get it to run,but it has error which is originated from pipeline.excute();
I checked user mail archive but i could't find the answers which bring me on.
I tried it with GUI and it worked. I saved the processes as gapp file, but could't run it again in java api.
Is there annyone who can help me?
source code is attached:
public class Gtest {
/**
* @param args
*/
@SuppressWarnings("deprecation")
public static void main(String[] args) throws GateException, IOException,ExecutionException{
Gate.init();
Corpus corpus = Factory.newCorpus("testCorpus");
File directory = new File("C:\\Documents and Settings\\Bonavision\\My Documents\\util1.0\\GateUebung1");
File docFile = new File("abc.txt");
Document doc = Factory.newDocument(docFile.toURL());
corpus.add(doc);
Gate.getCreoleRegister().registerDirectories(
new File(Gate.getPluginsHome(),"ANNIE").toURI().toURL()
);
Gate.getCreoleRegister().registerDirectories(
new File(Gate.getPluginsHome(),"Parser_Stanford").toURI().toURL()
);
Gate.getCreoleRegister().registerDirectories(
new File(Gate.getPluginsHome(),"MultiPaX-1.2").toURI().toURL()
);
Gate.getCreoleRegister().registerDirectories(
new File(Gate.getPluginsHome(),"Tools").toURI().toURL()
);
ProcessingResource sp = null;
sp = (ProcessingResource) Factory.createResource("gate.creole.splitter.SentenceSplitter");
ProcessingResource tok = null;
tok = (ProcessingResource) Factory.createResource("gate.creole.tokeniser.DefaultTokeniser");
ProcessingResource tagger = null;
tagger = (ProcessingResource) Factory.createResource("gate.creole.POSTagger");
ProcessingResource morphor = null;
morphor = (ProcessingResource) Factory.createResource("gate.creole.morph.Morph");
ProcessingResource parser = null;
parser = (ProcessingResource) Factory.createResource("gate.stanford.Parser");
FeatureMap params = Factory.newFeatureMap();
params.put("parserASName", "stanford");
ProcessingResource paExtractor = null;
paExtractor = (ProcessingResource) Factory.createResource("info.semanticsoftware.multiPaX.MultiPaX",params);
SerialAnalyserController pipeline = (SerialAnalyserController) Factory.createResource("gate.creole.SerialAnalyserController");
pipeline.add(sp);
pipeline.add(tok);
pipeline.add(tagger);
pipeline.add(morphor);
pipeline.add(parser);
pipeline.add(paExtractor);
pipeline.setCorpus(corpus);
pipeline.execute(); // from here the errormessage is originated
String docXmlString = null;
docXmlString = doc.toXml();
System.out.print(docXmlString);
}
}
- Login to post comments



StatusListener issue
Hi,
Please check if this is the same issue as reported here: http://www.semanticsoftware.info/forum/multipax-null-pointer-exception