SearchBox/SearchBox/StopwordTester.cs

22 lines
369 B
C#

using System;
using System.Collections.Generic;
namespace LibSearchBox
{
public class StopwordTester
{
private HashSet<string> words = new HashSet<string>();
public StopwordTester(IEnumerable<string> inWords)
{
foreach (string word in inWords)
words.Add(word);
}
public bool IsStopword(string word)
{
return words.Contains(word);
}
}
}