GATE: A working example for gate.corpora.DocumentJsonUtils -
i have been trying understand how use json exporter in gate located in gate.corpora.documentjsonutils
. can supply working example? not quite sure find or how construct map<string,collection<annotation>> annotationsmap
required methods.
here "quick" hack solved me. not sure why decided on particular data structure. not sure why not done internally default option derived document.
¯\_(ツ)_/¯
public static string makejson(document doc) { annotationset = doc.getannotations(); map<string, collection<annotation>> anns = new hashmap<>(); anns.put("myannotations", as.indocumentorder()); try { return documentjsonutils.tojson(doc, anns); } catch (ioexception ex) { return ""; } }
Comments
Post a Comment