Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocess.py
More file actions
Latest commit
48 lines (37 loc) · 1.13 KB
/
Copy pathprocess.py
File metadata and controls
48 lines (37 loc) · 1.13 KB
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
39
40
41
42
43
44
45
46
47
48
importnltk
importspeech_to_text
importtext_to_speech
defnoun(answer):
if"everything"inanswer.lower():
pass
text=nltk.word_tokenize(answer)
tags=nltk.pos_tag(text)
words= [wordforword, tagintagsiftagin ('NN','NNP','NNS')]
printwords
iflen(words)==1:
text_to_speech.get_speech("Are you looking for"+words[0])
answer=speech_to_text.stt()
printanswer
if"yes"inanswer.lower() or"ye"inanswer.lower():
pass
elif(len(words)>1):
a=""
a=" or ".join(words)
printa
text_to_speech.get_speech("What are you looking for"+a)
answer=speech_to_text.stt()
ifanswerinwords:
pass
#vision
defmain():
while(True):
text_to_speech.get_speech("command !")
answer=speech_to_text.stt()
printanswer
if"vision"inanswer.lower():
text_to_speech.get_speech("How may i help you ?")
answer=speech_to_text.stt()
noun(answer)
else:
text_to_speech.get_speech("Oops! Didn't catch that,pardon!")
main()