Skip to content

Commit

Permalink
completed search.py
Browse files Browse the repository at this point in the history
  • Loading branch information
privacyrespected committed Jan 31, 2022
1 parent d3a4123 commit 07f3770
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
Binary file added modules/__pycache__/sense.cpython-37.pyc
Binary file not shown.
19 changes: 19 additions & 0 deletions modules/search.py
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
from cv2 import mean
import wikipedia
from sense import speak
import re
from PyDictionary import PyDictionary
mean= PyDictionary()
def search_wiki(query):
results= wikipedia.summary(query, sentences=2)
results =str(results)
results=re.sub("[\(\[].*?[\)\]]", "", results)
speak(results)

def search_meaning(query):
results=mean.meaning(query)
results=str(results)
if re.search(",",results):
results=re.sub(",","( or)",results)
speak("For the word "+ query)
speak(results)

2 changes: 1 addition & 1 deletion modules/weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def print_weather(result,usercity):
speak("{}'s temperature is {} degress Celcius ".format(usercity,result['main']['temp']-273))
speak("Wind speed is {} meters per second".format(result['wind']['speed']))

speak("The weather looks {}".format(result['weather'][0]['description']))
speak("The weather description is {}".format(result['weather'][0]['description']))

print("Weather: {}".format(result['weather'][0]['main']))
def weathermain(usercity):
Expand Down
17 changes: 17 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
requests>=2.5.3
ChatterBot>=1.0.8
chatterbot-corpus>=1.2.0
win10toast>=0.9
wikipedia>=1.4.0
pyttsx3>=2.90
Eel>=0.12.4
SpeechRecognition>=3.8.1
pprintpp>=0.4.0
PyAutoGUI>=0.9.52
psutil>=5.7.3
playsound==1.2.2
spacy>=2.2.2
PyAudio>=0.2.11
numpy>=1.19.3
spacy
en-core-web-sm

0 comments on commit 07f3770

Please sign in to comment.