Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Another bump on the road

Status
Not open for further replies.

linuxjr

Programmer
Jun 2, 2001
135
US
Alright been doing good with the studies and getting most done. Now I have a stem() to figure out:


std::string stem (const std::string& word)
// Tries to guess the stem form of an English word by
//applying the following rules: (# and % stand for any
//consonant, and @ for any vowel [aeiou].
//
// If word ends in: replace it by: example:
// ies y flies => fly
// ied y carried => carry
// ier y merrier => merry
// iest y merriest => merry
// ##ed # hitted => hit
// ##ing # hitting => hit
// ##er # hitter => hit
// ##est # hottest => hot
// %@#ed %@#e glided => glide
// %@#ing %@#e gliding => glide
// %@#er %@#e glider => glide
// %@#est %@#e palest => pale
// #ed %# barked => bark
// #ing %# barking => bark
// #er %# colder => cold
// #est %# coldest => cold
// #s # things => thing
// If none of the above rules apply, then the word is
//assumed to be already in its stem form. This function
//returns the stem that it guesses. [Note that these really
//are guesses - it isn't hard to find words on which
// these rules fail. E.g., "pies"]
{
return word;
}
 
I have worked on this some on paper. I am curious for I don't have much to go on how to get started in this direction. I mean I understand the rules and such but I know its going to be this function and a few others that will be needed to help with some of the repeated sequences. I was just hoping someone done something similiar to this and could just give me a point in the direction. Thanks and have a nice day.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top