Skip to content

Instantly share code, notes, and snippets.

@neps-in
Last active March 24, 2022 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neps-in/59cbe6a038aec20d0f8523ac1a6cd3f4 to your computer and use it in GitHub Desktop.
Save neps-in/59cbe6a038aec20d0f8523ac1a6cd3f4 to your computer and use it in GitHub Desktop.
PorterStemmer Example
from nltk.stem import PorterStemmer
porter = PorterStemmer()
words = ['Connects','Connecting','Connections','Connected','Connection','Connectings','Connect']
for word in words:
print(word,"--->",porter.stem(word))
# ---- Output
Connects ---> connect
Connecting ---> connect
Connections ---> connect
Connected ---> connect
Connection ---> connect
Connectings ---> connect
Connect ---> connect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment