I'm creating a GATE app which used to find co-reference text. It works fine and I have created zipped file of the app by export option provided in GATE.
Now I'm trying to use the same in my Java code.
Gate.runInSandbox(true);
Gate.setGateHome(new File(gateHome));
Gate.setPluginsHome(new File(gateHome, "plugins"));
Gate.init();
URL applicationURL = new URL("file:" + new Path(gateHome, "application.xgapp").toString());
application = (CorpusController) PersistenceManager.loadObjectFromUrl(applicationURL);
corpus = Factory.newCorpus("Megaki Corpus");
application.setCorpus(corpus);
Document document = Factory.newDocument(text);
corpus.add(document);
application.execute();
corpus.clear();
Now how can I parse this document and get co-reference text?
I do not know about yours, but co-references created manually using the Co-reference Editor are stored in a document feature. The feature name seems to be
"MatchesAnnots"
and the typeMap<String, List<List<Integer>>>
.In my case, following code prints
as name: null
(the default annotation set) followed by all co-reference chains present in it.