-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathseedbot.py
More file actions
27 lines (27 loc) · 862 Bytes
/
seedbot.py
File metadata and controls
27 lines (27 loc) · 862 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
def getsentences(theinput):
sentences = []
currentsentence = ""
puncendings = [".","!","?"]
for i in range(len(theinput)):
try:
x = puncendings.index(theinput[i])
sentences.append(currentsentence)
currentsentence = ""
except:
currentsentence += theinput[i]
return sentences
def splitby(text,string):
thelist = text.split()
newlist = []
for i in range(len(thelist)):
if thelist[i]!=string:
newlist.append(thelist[i])
return newlist
def seedis():
theinput = raw_input("Enter Article: ")
thesentences = getsentences(theinput)
for i in range(len(thesentences)):
if "are" in thesentences[i]:
print splitby(thesentences[i],"are");
if "is" in thesentences[i]:
print splitby(thesentences[i],"is");