Encoding need for Google API

조회 수: 3 (최근 30일)
hanan
hanan 2011년 6월 8일
I'm trying to use my script to automatically using Google translate APIs from Arabic to english. Here is the code.
mytext = {some text in Arabic}
url = 'http://translate.google.com/translate_t';
page = urlread(url, 'get' ,{'v', '1.0','ie', 'UTF8','oe', 'UTF8','q', native2unicode(mytext,'utf8'), ...'langpair', ['ar' '|' 'en']});
Now I've tried using various encodings for mytext, including unicode, utf-8 but it never works. and the text send to Google API as ????? .Any idea if I need any codec?

답변 (1개)

Walter Roberson
Walter Roberson 2011년 6월 8일
5.3 You agree not to access (or attempt to access) any of the Services by any means other than through the interface that is provided by Google, unless you have been specifically allowed to do so in a separate agreement with Google. You specifically agree not to access (or attempt to access) any of the Services through any automated means (including use of scripts or web crawlers) and shall ensure that you comply with the instructions set out in any robots.txt file present on the Services.
  댓글 수: 3
Walter Roberson
Walter Roberson 2011년 6월 9일
If you try to do something you are prohibited from doing and it fails, then inquiring as to how to get around the technical problem is not the correct approach.
I believe you should be going back to the googleapis version.
hanan
hanan 2011년 6월 9일
OK, Is there any alternative way to use other translator with MATLAB?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Google에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by