Lucene.Net.Analysis.StopFilter.MakeStopSet C# (CSharp) Method

MakeStopSet() public static method

Builds a Set from an array of stop words, appropriate for passing into the StopFilter constructor. This permits this stopWords construction to be cached once when an Analyzer is constructed.
public static MakeStopSet ( ) : ISet
return ISet
		public static ISet<string> MakeStopSet(params string[] stopWords)
		{
			return MakeStopSet(stopWords, false);
		}
		

Same methods

StopFilter::MakeStopSet ( IList stopWords ) : ISet
StopFilter::MakeStopSet ( IList stopWords, bool ignoreCase ) : ISet
StopFilter::MakeStopSet ( string stopWords, bool ignoreCase ) : ISet

Usage Example

Beispiel #1
0
        public virtual void  TestStopFilt()
        {
            System.IO.StringReader reader    = new System.IO.StringReader("Now is The Time");
            System.String[]        stopWords = new System.String[] { "is", "the", "Time" };
            var            stopSet           = StopFilter.MakeStopSet(stopWords);
            TokenStream    stream            = new StopFilter(false, new WhitespaceTokenizer(reader), stopSet);
            ITermAttribute termAtt           = stream.GetAttribute <ITermAttribute>();

            Assert.IsTrue(stream.IncrementToken());
            Assert.AreEqual("Now", termAtt.Term);
            Assert.IsTrue(stream.IncrementToken());
            Assert.AreEqual("The", termAtt.Term);
            Assert.IsFalse(stream.IncrementToken());
        }
All Usage Examples Of Lucene.Net.Analysis.StopFilter::MakeStopSet