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

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -