コード例 #1
0
ファイル: RegexStemmer.cs プロジェクト: chadng/CherubNLP
        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]);
        }
コード例 #2
0
ファイル: RegexStemmer.cs プロジェクト: jorezy/CherubNLP
        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));
        }
コード例 #3
0
 public StemmerFactory(StemOptions options, SupportedLanguage lang)
 {
     _lang    = lang;
     _options = options;
     _stemmer = new IStem();
 }