コード例 #1
0
ファイル: Stemmer.cs プロジェクト: 0000duck/latino
        // *** IStemmer interface implementation ***

        public string GetStem(string word)
        {
            Utils.ThrowException(word == null ? new ArgumentNullException("word") : null);
            mStemmer.SetCurrent(word);
            mStemmer.Stem();
            return(mStemmer.GetCurrent());
        }
コード例 #2
0
ファイル: Stemmer.cs プロジェクト: mgrcar/Detextive
        // *** IStemmer interface implementation ***

        public string GetStem(string word)
        {
            Utils.ThrowException(word == null ? new ArgumentNullException("word") : null);
            try
            {
                ISnowballStemmer stemmer = CreateStemmer();
                stemmer.SetCurrent(word);
                stemmer.Stem();
                return(stemmer.GetCurrent());
            }
            catch { return(word); }
        }