public NameFinderEventStream(IObjectStream <NameSample> dataStream, string type, INameContextGenerator contextGenerator, ISequenceCodec <string> codec) : base(dataStream) { this.codec = codec ?? new BioCodec(); additionalContextFeatureGenerator = new AdditionalContextFeatureGenerator(); this.contextGenerator = contextGenerator; this.contextGenerator.AddFeatureGenerator(new WindowFeatureGenerator(additionalContextFeatureGenerator, 8, 8)); // TODO: How to make the type really do something?! // Type = type ?? "default"; }
/// <summary> /// Initializes a new instance of the <see cref="NameFinderME"/> using the given <see cref="TokenNameFinderModel"/>. /// </summary> /// <param name="model">The model.</param> /// <exception cref="System.ArgumentNullException">model</exception> public NameFinderME(TokenNameFinderModel model) { if (model == null) { throw new ArgumentNullException(nameof(model)); } sequenceCodec = model.Factory.CreateSequenceCodec(); sequenceValidator = sequenceCodec.CreateSequenceValidator(); this.model = model.NameFinderSequenceModel; contextGenerator = model.Factory.CreateContextGenerator(); // TODO: We should deprecate this. And come up with a better solution! additionalContextFeatureGenerator = new AdditionalContextFeatureGenerator(); contextGenerator.AddFeatureGenerator( new WindowFeatureGenerator(additionalContextFeatureGenerator, 8, 8)); }