Difference: StemmerCode (3 vs. 4)

Revision 42017-02-01 - JimSkon

Line: 1 to 1
 
META TOPICPARENT name="SdProject1"

Stemmer Example Code

%CODE{"c++"}% /*****************************************************************************/ /* */ /* Filename: stemExample.cpp */ /* Author(s): Jim Skon */ /* Last Update: 1/21/2017 */ /* */ /* This is a program that shows how to use the English word stemmer. */ /* */ /* */ /*****************************************************************************/

#include #include

Added:
>
>
#include <stdlib.h>
 #include #include // Include stemming stuff #include "english_stem.h"

using namespace std;

main () {

string word;

Changed:
<
<
stemming::english_stem<char, std::char_traits > StemEnglish;
>
>
stemming::english_stem<char, std::char_traits > StemEnglish;
  while (1) { cout << "Enter word the word to find the stem of: "; cin >> word; /* Convert word to upper case*/ transform(word.begin(), word.end(), word.begin(), ::toupper); string saveWord = word; /* Reduce to Stem */ StemEnglish (word); cout << "The stemmed version of \"" << saveWord << "\" is \"" << word << "\"" << endl; } } %ENDCODE%
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback