/// <summary> /// Creates a token filter. /// </summary> /// <param name="name">Sets the name of the token filter.</param> /// <param name="type">Sets the type of the token filter.</param> public TokenFilterBase(string name, TokenFilterTypeEnum type) { if (string.IsNullOrWhiteSpace(name)) throw new ArgumentNullException("name", "Token Filters require a name."); if (type == null) throw new ArgumentNullException("type", "Token Filters require a type."); Name = name; Type = type; }
private CompoundWordTokenFilter(string name, TokenFilterTypeEnum type) : base(name, type) { MinimumWordSize = _MINIMUM_WORD_SIZE_DEFAULT; MinimumSubWordSize = _MINIMUM_SUBWORD_SIZE_DEFAULT; MaximumSubWordSize = _MAXIMUM_SUBWORD_SIZE_DEFAULT; OnlyLongestMatch = _ONLY_LONGEST_MATCH_DEFAULT; }
/// <summary> /// Creates a compound word token filter based on a path to the configuration word list file. /// </summary> /// <param name="name">Sets the name of the token filter.</param> /// <param name="type">Sets the type of the token filter.</param> /// <param name="wordListPath">Sets the path to the word list configuration file.</param> public CompoundWordTokenFilter(string name, TokenFilterTypeEnum type, string wordListPath) : this(name, type) { if (string.IsNullOrWhiteSpace(wordListPath)) throw new ArgumentNullException("wordListPath", "CompoundWordTokenFilter requires a path to the word list file in this constructor."); WordListPath = wordListPath; }
/// <summary> /// Create a compound word token filter based on a list of words. /// </summary> /// <param name="name">Sets the name of the token filter.</param> /// <param name="type">Sets the type of the token filter.</param> /// <param name="wordList">Sets the word list.</param> public CompoundWordTokenFilter(string name, TokenFilterTypeEnum type, IEnumerable<string> wordList) : this(name, type) { if (wordList == null || wordList.All(x => string.IsNullOrWhiteSpace(x))) throw new ArgumentNullException("wordList", "CompoundWordTokenFilter requires a word list in this constructor."); WordList = wordList; }