ABB.Swum.FileStemmer.Stem C# (CSharp) Method

Stem() public method

Returns the stem for the given word.
public Stem ( string word ) : string
word string The word to stem.
return string
        public override string Stem(string word)
        {
            if (Stems.ContainsKey(word.ToLower()))
                return Stems[word.ToLower()];
            else
                return word;
        }
    }

Usage Example

Example #1
0
        public override void Execute()
        {
            //set defaults for optional parameters
            if (StemFile == null)
            {
                StemFile = @"lib\KStem.txt";
            }

            FileStemmer stemmer = new FileStemmer(StemFile);
            Console.WriteLine("{0} -> {1}", Word, stemmer.Stem(Word));
        }