Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2021-060
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chalika Mihiran
2021-060
Commits
900e3bca
Commit
900e3bca
authored
Jul 03, 2021
by
IT18126884
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Double Words check
parent
daf9be91
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
DoubleWords.py
DoubleWords.py
+24
-0
No files found.
DoubleWords.py
0 → 100644
View file @
900e3bca
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment