Exemple #1
0
        public string Stem(string word, StemOptions options)
        {
            var match = _regex.Matches(word).Cast <Match>().FirstOrDefault();

            return(match == null ?
                   word :
                   word.Substring(0, match.Index) + replacements[match.Value]);
        }
Exemple #2
0
        public string Stem(string word, StemOptions options)
        {
            _regex = new Regex(options.Pattern);

            var match = _regex.Matches(word).Cast <Match>().FirstOrDefault();

            return(match == null ? word : word.Substring(0, match.Index));
        }
 public StemmerFactory(StemOptions options, SupportedLanguage lang)
 {
     _lang    = lang;
     _options = options;
     _stemmer = new IStem();
 }