Skip to content

Commit

Permalink
some improvements for engine and offical data
Browse files Browse the repository at this point in the history
  • Loading branch information
onuratakan committed Aug 6, 2021
1 parent 407a050 commit bab1255
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 6 deletions.
12 changes: 9 additions & 3 deletions src/ONUR_Voice_Assistant/ONUR_Voice_Assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,15 @@ def engine(self, expression):
know = False

for situation in self.data:
if situation[0] in expression:
know = True
exec(situation[1])
if not type(situation[0]) == list:
if situation[0] in expression:
know = True
exec(situation[1])
else:
for sub_situation_trigger in situation[0]:
if sub_situation_trigger in expression:
know = True
exec(situation[1])

if not know and not expression == "":
say("""I don't now""")
Expand Down
30 changes: 27 additions & 3 deletions src/ONUR_Voice_Assistant/offical_data_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,31 @@ def open_youtube():


OFFICAL_DATA = [
["open on google", "open_on_google()"],
["open facebook", "open_facebook()"],
["open youtube", "open_youtube()"]
[
[
"how are you",
],
"how_are_you()"
],
[
[
"open google",
"open search engine",
],
"open_on_google()"
],
[
[
"open facebook",
"open the facebook",
],
"open_facebook()"
],
[
[
"open youtube",
"open the youtube",
],
"open_youtube()"
],
]

0 comments on commit bab1255

Please sign in to comment.