alotaiba / SiriProxy-Asiri

Let Siri speak your language with Asiri plugin for SiriProxy. Thanks to Google speach recognition service, Asiri can be configured to speak any language that is supported by Google.
Other
29 stars 13 forks source link

How to make Complete Language Change? #5

Closed iPhoneV8 closed 12 years ago

iPhoneV8 commented 12 years ago

Hi..Abdul :)

This is nice idea ...you are cool man :)

its work on my language , but i want to make it complete change the language . How to make it ?

ex. in my language : "cek cuaca hari ini" ( original:check the weather for today ) my question is : how to make reply from guzzoni like normal Siri and show the weather for today ,but siri say on my language ? Hope you can help :)

regards

alotaiba commented 12 years ago

Hi,

Thanks for your kind words.

I'm sorry, I don't understand your question.

Does Asiri work for your language? If yes, then can you explain your issue a little bit more. If no, what's you language? Because Google speech recognition system, which Asiri uses, supports limited languages.

iPhoneV8 commented 12 years ago

yes ,it work for my languange / indonesia (id-ID) my question is : how to make siri that can recognize all the commands in the Indonesian (my language) ?

Example : -Original siri command " check the weather for today" and siri reply with the weather result.

i want to change that "check the weather today" to my language. and siri reply using my language and show the result for weather ..

sorry my bad english :(

alotaiba commented 12 years ago

Unfortunately, you will have to re-implement the original commands by Siri in your own language, and have your own implementation for the views when you get the reply.

For your example, you'd need to listen_for check the weather for today, and get a response form Yahoo's weather service, then send it back to the client.

iPhoneV8 commented 12 years ago

that's it what i mean :)

and how to do like listen_for ?

iPhoneV8 commented 12 years ago

i edited ar-QA.rb to my my languages like this :

class SiriProxy::Plugin::Asiri < SiriProxy::Plugin

listen_for /selamat pagi/ do say "Selamat Pagi, Bos", spoken: "Selamat Pagi Bos"

request_completed

end

listen_for /tes koneksi/ do say "Siri Proxy Roxy Selindo, Mantap!", spoken: "Siri Proxy Roxy Selindo, Mantap"

request_completed

end

listen_for /terima kasih/ do say "Saya Senang melayani Anda", spoken: "Saya Senang melayani Anda"

request_completed

end

end

alotaiba commented 12 years ago

Have a look at the languages folder, which you should've copied to your ~/.siriproxy folder if you followed the instructions correctly. You should see two examples, one for English, and the other is in Arabic.

This is a basic example:

listen_for /عليكم/ do
    say "وعليكم السلام", spoken: "Walikum Alsalam"
    request_completed
end

So you should change /عليكم/ to the string you want to capture and reply to. then process everything else inside the block.

Don't forget to rename your file to id-ID.rb and change the config.yml accrodingly.

iPhoneV8 commented 12 years ago

Yes. i had done with that basic command and it Works ..

but i don't understand how to implement this : For your example, you'd need to listen_for check the weather for today, and get a response form Yahoo's weather service, then send it back to the client.

iPhoneV8 commented 12 years ago

can you help to write in ruby for implement "check the weather for today"

alotaiba commented 12 years ago

If you've got Asiri working fine then there's no issue. Your issue is beyond Asiri.

I don't like to teach by writing complete code for other people, as this will be a very bad habit for you. But I don't mind giving you hints and basic implementation, and you should take it from there.

Have a look at httparty gem. You should have it installed by default, because it comes with SiriProxy.

Here's a basic GET request for Yahoo's weather API, it fetches the current temperature for Doha id = 1940517.

require 'httparty'

response = HTTParty.get("http://weather.yahooapis.com/forecastjson?w=1940517&u=c")
puts response["condition"]["text"]
puts response["condition"]["temperature"]

Example output:

Sunny
23.0
iPhoneV8 commented 12 years ago

Thank's and this very heplful