Skip to content

Instantly share code, notes, and snippets.

@shubham-singh-ss
Last active July 18, 2019 06:10
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 shubham-singh-ss/c942835d943a2f75656c30962756adb8 to your computer and use it in GitHub Desktop.
Save shubham-singh-ss/c942835d943a2f75656c30962756adb8 to your computer and use it in GitHub Desktop.
# from textblob lib import Word method
from textblob import Word
text = """He determined to drop his litigation with the monastry, and relinguish his claims to the wood-cuting and
fishery rihgts at once. He was the more ready to do this becuase the rights had become much less valuable, and he had
indeed the vaguest idea where the wood and river in question were."""
lem = []
for i in text.split():
word1 = Word(i).lemmatize("n")
word2 = Word(word1).lemmatize("v")
word3 = Word(word2).lemmatize("a")
lem.append(Word(word3).lemmatize())
print(lem)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment