Created
April 14, 2015 07:27
-
-
Save rehrumesh/7af8a2e0004a4305716a to your computer and use it in GitHub Desktop.
SCS4011 Lab3 Stemmer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def stem(word): | |
for suffix in ['ing','ly','ed','ious','ies','ive','es','s']: | |
if word.endswith(suffix): | |
return word[:-len(suffix)] | |
return word |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment