Commit 900e3bca authored by IT18126884's avatar IT18126884

add Double Words check

parent daf9be91
import spacy
# In here we are importing stop words from spacy. there are already spefied stop words there in the spacy
from spacy.lang.en.stop_words import STOP_WORDS
from string import punctuation
from heapq import nlargest
text = """
Surprisingly Abraham really did nothing nothing important in his life.
He was not not a great writer, king, inventor or military leader.
He did nothing except camp out out where he was told to to go and father a few children.
"""
stopwords = list(STOP_WORDS)
# print(stopwords)
nlp = spacy.load('en_core_web_sm')
doc = nlp(text)
# Tokenization
tokens = [token.text for token in doc]
for i in range(len(tokens)):
if tokens[i] == tokens[i + 1]:
print(f" You stuck in this word :{tokens[i]}");
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment