Difference: StemmerCode (1 vs. 4)

Revision 42017-02-01 - JimSkon

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

Stemmer Example Code

Line: 16 to 16
  #include #include
Added:
>
>
#include <stdlib.h>
 #include #include // Include stemming stuff
Line: 27 to 28
  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: ";

Revision 32017-01-24 - JimSkon

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

Stemmer Example Code

Line: 16 to 16
  #include #include
Deleted:
<
<
#include
 #include #include // Include stemming stuff
Line: 38 to 37
  string saveWord = word; /* Reduce to Stem */ StemEnglish (word);
Changed:
<
<
cout << "The stemmed version of \"" << saveWord <<"\" is \"" << word << "\"" << endl;
>
>
cout << "The stemmed version of \"" << saveWord << "\" is \"" << word << "\"" << endl;
  } } %ENDCODE% \ No newline at end of file

Revision 22017-01-23 - JimSkon

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

Stemmer Example Code

Changed:
<
<
>
>
 %CODE{"c++"}% /*****************************************************************************/ /* */
Line: 31 to 31
  stemming::english_stem<char, std::char_traits > StemEnglish;

while (1) {

Changed:
<
<
cout << "Enter word the word to find the stem of: "; cin >> word;
>
>
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);
Changed:
<
<
cout << "The stemmed version of \"" << saveWord <<"\" is \"" << word << "\"" << endl;
>
>
cout << "The stemmed version of \"" << saveWord <<"\" is \"" << word << "\"" << endl;
  } }
Changed:
<
<
%ENDCODE%
>
>
%ENDCODE%
 \ No newline at end of file

Revision 12017-01-23 - JimSkon

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

Stemmer Example Code

<-- SyntaxHighlightingPlugin -->
/*****************************************************************************/
/*                                                                           */
/*  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 <iostream>
#include <string>
#include
#include <utility>
#include <algorithm>
// Include stemming stuff
#include "english_stem.h"

using namespace std;

main () {

  string word;

  stemming::english_stem&lt;char, std::char_traits<char> &gt; StemEnglish;

  while (1) {
    cout &lt;&lt; "Enter word the word to find the stem of: ";
    cin &gt;&gt; word;
    /* Convert word to upper case*/
    transform(word.begin(), word.end(), word.begin(), ::toupper);
    string saveWord = word;
    /* Reduce to Stem */
    StemEnglish (word);
    cout &lt;&lt; "The stemmed version of \"" &lt;&lt; saveWord &lt;&lt;"\" is \"" &lt;&lt; word &lt;&lt; "\"" &lt;&lt; endl;
  }
}
<-- end SyntaxHighlightingPlugin -->
 
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