/// <summary> /// <para>Set the min shingle size (default: 2). /// </para> /// <para>This method requires that the passed in minShingleSize is not greater /// than maxShingleSize, so make sure that maxShingleSize is set before /// calling this method. /// </para> /// <para>The unigram output option is independent of the min shingle size. /// /// </para> /// </summary> /// <param name="minShingleSize"> min size of output shingles </param> public void SetMinShingleSize(int minShingleSize) { if (minShingleSize < 2) { throw new ArgumentException("Min shingle size must be >= 2"); } if (minShingleSize > maxShingleSize) { throw new ArgumentException("Min shingle size must be <= max shingle size"); } this.minShingleSize = minShingleSize; gramSize = new CircularSequence(this); }
/// <summary> /// <para>Set the min shingle size (default: 2). /// </para> /// <para>This method requires that the passed in minShingleSize is not greater /// than maxShingleSize, so make sure that maxShingleSize is set before /// calling this method. /// </para> /// <para>The unigram output option is independent of the min shingle size. /// /// </para> /// </summary> /// <param name="minShingleSize"> min size of output shingles </param> public void SetMinShingleSize(int minShingleSize) { if (minShingleSize < 2) { throw new ArgumentOutOfRangeException(nameof(minShingleSize), "Min shingle size must be >= 2"); // LUCENENET specific - changed from IllegalArgumentException to ArgumentOutOfRangeException (.NET convention) } if (minShingleSize > maxShingleSize) { throw new ArgumentException("Min shingle size must be <= max shingle size"); } this.minShingleSize = minShingleSize; gramSize = new CircularSequence(this); }
/// <summary> /// Shall the output stream contain the input tokens (unigrams) as well as /// shingles? (default: true.) /// </summary> /// <param name="outputUnigrams"> Whether or not the output stream shall contain /// the input tokens (unigrams) </param> public void SetOutputUnigrams(bool outputUnigrams) { this.outputUnigrams = outputUnigrams; gramSize = new CircularSequence(this); }