public static TokenizerModel train(ObjectStream<TokenSample> samples, TokenizerFactory factory,
TrainingParameters mlParams) throws IOException {
Map<String, String> manifestInfoEntries = new HashMap<String, String>();
EventStream eventStream = new TokSpanEventStream(samples,
factory.isUseAlphaNumericOptmization(),
factory.getAlphaNumericPattern(), factory.getContextGenerator());
AbstractModel maxentModel = TrainUtil.train(eventStream,
mlParams.getSettings(), manifestInfoEntries);