Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
hmangukia committed Aug 22, 2018
1 parent 69be3e4 commit 3651fdb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion windows/activities.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ NOTE: All the recorded files will be saved on the desktop. Make sure that the fi
* "***get tweets***" Get latest 10 tweets from timeline. For this an app is to be registered at https://apps.twitter.com/ (if confused, have a look at https://spring.io/guides/gs/register-twitter-app/). A new file named "twitterCredentials.py" is to be made in the windows folder. Save the consumer key, consumer secret, access token, access token secret with the names consumer_key, consumer_secret, access_token, access_secret repectively in the "twitterCredentials.py". Speak/type "get tweets" and top 10 tweets will be shown, also when and by whom it was created.
* Get latest 10 tweets done by the user. Speak/type "get my tweets" and top 10 tweets done by the user(you) will be shown with the time when it was tweeted
* You can get a list of everyone you follow from twitter by saying "get list of people I follow on twitter"
* "***translate text***" Say "translate" and then the text you want to translate. For example, say "translate how are you to french" or "translate hallo welt to english". (Note: English, Spanish, French, German, Italian and Portuguese are supported)
* "***translate text***" Say "translate" and then the text you want to translate. For example, say "translate how are you to French" or "translate hallo welt to English". (Note: English, Spanish, French, German, Italian and Portuguese are supported)

>In cases where the commands are separated by '/', use any one of the mentioned commands
>For example, use either ***What is your name*** or ***Identify Yourself*** or ***Who are you***. Don't type all of them at once.
Expand Down
10 changes: 8 additions & 2 deletions windows/benji.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ def events(frame,put):
#translate
if link[0] == "translate" and link[-2] == "to":
translator = Translator()
l = link[1:-2]
pystring = " ".join(l)
pystring = " ".join(link[1:-2])
lang = detect(pystring)
if link[-1] == "english":
id = "en"
Expand All @@ -94,8 +93,15 @@ def events(frame,put):
id = "it"
elif link[-1] == "portugese" or link[-1] == "portuguese":
id = "pt"
else:
id = "en"
translated = translator.translate(pystring, src=lang, dest=id)
print(translated.text)
try:
speak.say("The translated text is "+translated.text)
speak.runAndWait()
except:
print('Error.')

#Add user for face detection
elif link[0] == "face" or link[0] == "phase":
Expand Down

0 comments on commit 3651fdb

Please sign in to comment.