if (TrainerType.EVENT_MODEL_TRAINER.equals(trainerType)) {
ObjectStream<Event> eventStream = new NameFinderEventStream(samples, type,
factory.createContextGenerator(), factory.createSequenceCodec());
EventTrainer trainer = TrainerFactory.getEventTrainer(trainParams.getSettings(), manifestInfoEntries);
nameFinderModel = trainer.train(eventStream);
} // TODO: Maybe it is not a good idea, that these two don't use the context generator ?!
// These also don't use the sequence codec ?!
else if (TrainerType.EVENT_MODEL_SEQUENCE_TRAINER.equals(trainerType)) {
NameSampleSequenceStream ss = new NameSampleSequenceStream(samples, factory.createContextGenerator());
EventModelSequenceTrainer trainer = TrainerFactory.getEventModelSequenceTrainer(
trainParams.getSettings(), manifestInfoEntries);
nameFinderModel = trainer.train(ss);
} else if (TrainerType.SEQUENCE_TRAINER.equals(trainerType)) {
SequenceTrainer trainer = TrainerFactory.getSequenceModelTrainer(
trainParams.getSettings(), manifestInfoEntries);
NameSampleSequenceStream ss = new NameSampleSequenceStream(samples, factory.createContextGenerator(), false);
seqModel = trainer.train(ss);
} else {
throw new IllegalStateException("Unexpected trainer type!");
}
if (seqModel != null) {