-
-
Save neps-in/59cbe6a038aec20d0f8523ac1a6cd3f4 to your computer and use it in GitHub Desktop.
PorterStemmer Example
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
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