POSModel model;
try {
// TODO: Move to util method ...
POSDictionary tagdict = null;
if (parameters.getDictionaryPath() != null) {
tagdict = new POSDictionary(parameters.getDictionaryPath());
}
// depending on model and sequence choose training method
model = opennlp.tools.postag.POSTaggerME.train(parameters.getLanguage(),
sampleStream, parameters.getModel(), tagdict, null, parameters.getCutoff(), parameters.getNumberOfIterations());