-
Notifications
You must be signed in to change notification settings - Fork 1
/
article_checker.py
39 lines (34 loc) · 1.05 KB
/
article_checker.py
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
28
29
30
31
32
33
34
35
36
37
38
import nltk
from nltk.stem.wordnet import WordNetLemmatizer
from pattern.en import referenced
wnl=WordNetLemmatizer()
wnl.lemmatize('better','a')
var = input("Enter some text:" )
i=0;
# vowels=['A','E','I','O','U']
count=0;
lines=re.split('\? |\?|\. |\.|! |!',var);
for x in lines:
if(i!=len(lines)-1):
x1=x.split(" ");
# print(x1)
count=0;
for w in x1:
count=count+1
# print(w)
if(w=="a" or w=="A"):
word = x1[count].lower()
# l=arpabet[word][0]
# p=l[0][0]
# if p in vowels:
# s="Would u like to change "+w+" "+word+" to an "+word+"?"
# reply=input(s)
# elif (w=="an" or w=="An"):
# word = x1[count].lower()
# l=arpabet[word][0]
# p=l[0][0]
# if p not in vowels:
# s="Would u like to change "+w+" "+word+" to a "+word+"?"
# reply=input(s)
i=i+1;
def check_article(s):