2018-09-02 15:36:37 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
2018-09-11 13:27:25 +00:00
|
|
|
|
namespace LibSearchBox
|
2018-09-02 15:36:37 +00:00
|
|
|
|
{
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|