I am trying to run a tagger through batch file for different file to do so I am creating a
batch file
and running tagger through it. and this is my code..
String runap1="cd spt1"+"\n"+"java -Xss8192K -Xms128m -Xmx640m -classpath stanford-postagger.jar edu.stanford.nlp.tagger.maxent.MaxentTagger -model models/bidirectional-wsj-0-18.tagger -textFile "+fff[g]+">tag\\"+r1+"\nexit" ;
////////////////
FileWriter fw1 = new FileWriter("ac.bat");
BufferedWriter bw1 = new BufferedWriter(fw1);
bw1.write(runap1);
bw1.close();
Runtime rx= Runtime.getRuntime();
Process p=null;
try
{
p=rx.exec("cmd.exe /c start ac.bat");
}
catch(Exception e)
{
System.out.println("Error");
}// TOD}
try
{Thread.sleep(15000);}
catch (InterruptedException e)
{ System.out.println("Thread interrupted");
}
this takes a long time to process and several times my pc being hanged. I want to make a shared memory for the tagger to load it only once and all batch files will use that shared tagger, they should not load tagger each time. How can I do this?