"IO error while building NGram Dictionary: " + e.getMessage(), e);
}
System.err.println("done");
}
POSTaggerFactory postaggerFactory = null;
try {
postaggerFactory = POSTaggerFactory.create(params.getFactory(), ngramDict, null);
} catch (InvalidFormatException e) {
throw new TerminateToolException(-1, e.getMessage(), e);
}
if (params.getDict() != null) {
try {
postaggerFactory.setTagDictionary(postaggerFactory
.createTagDictionary(params.getDict()));
} catch (IOException e) {
throw new TerminateToolException(-1,
"IO error while loading POS Dictionary: " + e.getMessage(), e);
}
}
if (params.getTagDictCutoff() != null) {
try {
TagDictionary dict = postaggerFactory.getTagDictionary();
if (dict == null) {
dict = postaggerFactory.createEmptyTagDictionary();
postaggerFactory.setTagDictionary(dict);
}
if (dict instanceof MutableTagDictionary) {
POSTaggerME.populatePOSDictionary(sampleStream, (MutableTagDictionary)dict,
params.getTagDictCutoff());
} else {