mdict.persist(new File(dict));
}
EventStream es;
if (encoding == null) {
if (dict == null) {
es = new POSEventStream(new PlainTextByLineDataStream(new InputStreamReader(new FileInputStream(inFile))));
}
else {
es = new POSEventStream(new PlainTextByLineDataStream(new InputStreamReader(new FileInputStream(inFile))), new Dictionary(dict));
}
}
else {
if (dict == null) {
es = new POSEventStream(new PlainTextByLineDataStream(new InputStreamReader(new FileInputStream(inFile),encoding)));
}
else {
es = new POSEventStream(new PlainTextByLineDataStream(new InputStreamReader(new FileInputStream(inFile),encoding)), new Dictionary(dict));
}
}
mod = train(es, iterations, cutoff);
System.out.println("Saving the model as: " + outFile);
new SuffixSensitiveGISModelWriter(mod, outFile).persist();