I have a stemmer that outputs some words from a file. I want a Regex that will find every word that ends with “e” and then remove the “e”.
>>> def stemmer(word):
[(stem,end)] = re.findall('^(.*e)?$',word)
return stem
Could you please help me to get it right?
Cheers.
Apply
\b([A-Za-z]+)e\bto your input globally, not only to a word.\bis the word anchor.