/// <summary>
        /// Adds a feature generator to this set of feature generators.
        /// </summary>
        /// <param name="featureGenerator">The feature generator to add.</param>
        public void AddFeatureGenerator(IAdaptiveFeatureGenerator featureGenerator)
        {
            if (featureGenerator == null)
            {
                throw new ArgumentNullException(nameof(featureGenerator));
            }

            featureGenerators.Add(featureGenerator);
        }
Пример #2
0
 /// <summary>
 /// Initializes the current instance with the given parameters.
 /// </summary>
 /// <param name="generator">Feature generator to apply to the window.</param>
 /// <param name="prevWindowSize">Size of the window to the left of the current token.</param>
 /// <param name="nextWindowSize">Size of the window to the right of the current token.</param>
 public WindowFeatureGenerator(IAdaptiveFeatureGenerator generator, int prevWindowSize, int nextWindowSize)
 {
     this.generator      = generator;
     this.prevWindowSize = prevWindowSize;
     this.nextWindowSize = nextWindowSize;
 }
Пример #3
0
 /// <summary>
 /// Initializes the current instance. The previous and next window size is 5.
 /// </summary>
 /// <param name="generator">The feature generator.</param>
 public WindowFeatureGenerator(IAdaptiveFeatureGenerator generator) : this(generator, 5, 5)
 {
 }
Пример #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NameSampleSequenceStream"/> class.
 /// </summary>
 /// <param name="psi">The sample stream.</param>
 /// <param name="featureGen">The feature generator.</param>
 public NameSampleSequenceStream(IObjectStream <NameSample> psi, IAdaptiveFeatureGenerator featureGen)
     : this(psi, new DefaultNameContextGenerator(featureGen), true)
 {
 }
Пример #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NameSampleSequenceStream"/> class.
 /// </summary>
 /// <param name="psi">The sample stream.</param>
 /// <param name="featureGen">The feature generator.</param>
 /// <param name="useOutcomes">if set to <c>true</c> will be used in the samples.</param>
 public NameSampleSequenceStream(IObjectStream <NameSample> psi, IAdaptiveFeatureGenerator featureGen,
                                 bool useOutcomes) : this(psi, new DefaultNameContextGenerator(featureGen), useOutcomes)
 {
 }
Пример #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NameSampleSequenceStream"/> class.
 /// </summary>
 /// <param name="psi">The sample stream.</param>
 /// <param name="featureGen">The feature generator.</param>
 /// <param name="useOutcomes">if set to <c>true</c> will be used in the samples.</param>
 public NameSampleSequenceStream(IObjectStream<NameSample> psi, IAdaptiveFeatureGenerator featureGen,
     bool useOutcomes) : this(psi, new DefaultNameContextGenerator(featureGen), useOutcomes) {}
        /// <summary>
        /// Adds a feature generator to this set of feature generators.
        /// </summary>
        /// <param name="featureGenerator">The feature generator to add.</param>
        public void AddFeatureGenerator(IAdaptiveFeatureGenerator featureGenerator) {
            if (featureGenerator == null)
                throw new ArgumentNullException("featureGenerator");

            featureGenerators.Add(featureGenerator);
        }
Пример #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NameSampleSequenceStream"/> class.
 /// </summary>
 /// <param name="psi">The sample stream.</param>
 /// <param name="featureGen">The feature generator.</param>
 public NameSampleSequenceStream(IObjectStream<NameSample> psi, IAdaptiveFeatureGenerator featureGen)
     : this(psi, new DefaultNameContextGenerator(featureGen), true) {}
 public CachedFeatureGenerator(params IAdaptiveFeatureGenerator[] generators) {
     generator = new AggregatedFeatureGenerator(generators);
     contextsCache = new Cache(100);
 }
Пример #10
0
 /// <summary>
 /// Initializes the current instance with the given parameters.
 /// </summary>
 /// <param name="generator">Feature generator to apply to the window.</param>
 /// <param name="prevWindowSize">Size of the window to the left of the current token.</param>
 /// <param name="nextWindowSize">Size of the window to the right of the current token.</param>
 public WindowFeatureGenerator(IAdaptiveFeatureGenerator generator, int prevWindowSize, int nextWindowSize) {
     this.generator = generator;
     this.prevWindowSize = prevWindowSize;
     this.nextWindowSize = nextWindowSize;
 }
Пример #11
0
 /// <summary>
 /// Initializes the current instance. The previous and next window size is 5.
 /// </summary>
 /// <param name="generator">The feature generator.</param>
 public WindowFeatureGenerator(IAdaptiveFeatureGenerator generator) : this(generator, 5, 5) {}
Пример #12
0
 public CachedFeatureGenerator(params IAdaptiveFeatureGenerator[] generators)
 {
     generator     = new AggregatedFeatureGenerator(generators);
     contextsCache = new Cache(100);
 }