*/
public static TokenizerModel train(String languageCode,
ObjectStream<TokenSample> samples, Dictionary abbreviations,
boolean useAlphaNumericOptimization, TrainingParameters mlParams)
throws IOException {
Factory factory = new Factory();
Map<String, String> manifestInfoEntries = new HashMap<String, String>();
EventStream eventStream = new TokSpanEventStream(samples,
useAlphaNumericOptimization, factory.getAlphanumeric(languageCode),
factory.createTokenContextGenerator(languageCode,
getAbbreviations(abbreviations)));
AbstractModel maxentModel = TrainUtil.train(eventStream,
mlParams.getSettings(), manifestInfoEntries);