java - Gate- Loading a gapp file is taking time .Hoe can I reduce it? -


i working on gate related project.
so, here creating pipeline through gate. using .gapp file in java code. so, loading .gapp file, takes around 10 seconds, application.

how can solve issue?

second problem that, have system.exit after processing document release memory, if didn't got outofmemoryerror.

so, how can solve these issues?

my code like:

public class gatemainclass {      corpuscontroller application = null;     corpus corpus = null;      public void processapp(string gatehome, string gapfilepath, string docsourcepath, string issingledocument) throws resourceinstantiationexception {         try {             if (!gate.isinitialised()) {                 gate.runinsandbox(true);                 gate.setgatehome(new file(gatehome));                 gate.setpluginshome(new file(gatehome, "plugins"));                 gate.init();             }             application = (corpuscontroller) persistencemanager.loadobjectfromfile(new file(gapfilepath));             corpus = factory.newcorpus("main");             application.setcorpus(corpus);              if(issingledocument.equals(boolean.true.tostring())) {                 document doc = factory.newdocument(new file(docsourcepath).touri().tourl());                 corpus.add(doc);              } else {                 file[] files;                 file folder = new file(docsourcepath);                 files = folder.listfiles(new fileutil.customfilenamefilter(".xml"));                 arrays.sort(files, lastmodifiedfilecomparator.lastmodified_reverse);                 (int = 0; < files.length; i++) {                     document doc = factory.newdocument(files[i].touri().tourl());                     corpus.add(doc);                 }             }             application.execute();         } catch (exception e) {             e.printstacktrace();         } {           corpus.clear();         }     } 

and gapp file like:

1.document reset pr 2.annie english tokenizer. 3.annie gazetteer. 4.annie sentence spiliter. 5.annie pos tagger. 6.gate morphological analyser. 7.flexible gazetteer. 8.html markup transfer 9.main jape file. 


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -