Yes, you are correct. I should have been more clear and said that the API accepts uri-encoded strings well in excess of 1,000 characters. For languages such as Chinese and other non-Latin alphabets, you will find that your mileage will vary greatly because so many characters need to be encoded.
That said, it would still be advisable to split your text by sentences or even clauses within sentences, rather than a strict character count. The machine translation engine of the Language API relies heavily on context to provide a better translation. Jeremy R. Geerdes Effective website design & development Des Moines, IA For more information or a project quote: http://jgeerdes.home.mchsi.com http://jgeerdes.blogspot.com http://jgeerdes.wordpress.com [email protected] Unless otherwise noted, any price quotes contained within this communication are given in US dollars. If you're in the Des Moines, IA, area, check out Debra Heights Wesleyan Church! And check out my blog, Adventures in Web Development, at http://jgeerdes.blogspot.com ! On Dec 9, 2009, at 9:00 PM, J wrote: > Thank you for your patience. > > My c# program sent a request include Incomplete html code,so it got > wrong response data. > I can fix it by add html tag character in my sentense rule. > > And I still have a question: > > --- "the API will accept requests well in excess of 1,000 characters > via the GET interface" > My C# program translate text from Chinese to English. > If the whole request url(and encoded like %3C%3E) is permit to 1,000 > characters length,My program can only send Chinese characters within > 180 length. > A、http://ajax.googleapis.com/ajax/services/language/translate? > v=1.0&q=<DIV class=right> <UL> <LI>分解式研磨剂是什么? </LI> > <LI> <P > class=duan>本品为恢复车身原有光泽和色彩设计,采用双重抛光颗粒,含有漆 > 面去污剂、还原剂、光亮剂等多种成份。能有效可快速去除氧化层、细 > 微划痕、污垢、沥青等。经简单处理,即可得到一个还原光亮的镜面。</P></ > LI> &langpair=zh-CN|en (256 > characters ) > B、http://ajax.googleapis.com/ajax/services/language/translate? > v=1.0&q= > %3CDIV%20class=right%3E%20%20%3CUL%3E%20%20%3CLI%3E%B7%D6%BD%E2%CA%BD > %D1%D0%C4%A5%BC%C1%CA%C7%CA%B2%C3%B4%A3%BF%20%3C/LI%3E%20%20%3CLI%3E > %20%20%3CP%20class=duan%3E%B1%BE%C6%B7%CE%AA%BB%D6%B8%B4%B3%B5%C9%ED > %D4%AD%D3%D0%B9%E2%D4%F3%BA%CD%C9%AB%B2%CA%C9%E8%BC%C6%A3%AC > %B2%C9%D3%C3%CB%AB%D6%D8%C5%D7%B9%E2%BF%C5%C1%A3%A3%AC%BA%AC > %D3%D0%C6%E1%C3%E6%C8%A5%CE%DB%BC%C1%A1%A2%BB%B9%D4%AD%BC > %C1%A1%A2%B9%E2%C1%C1%BC%C1%B5%C8%B6%E0%D6%D6%B3%C9%B7%DD%A1%A3%C4%DC > %D3%D0%D0%A7%BF%C9%BF%EC%CB%D9%C8%A5%B3%FD%D1%F5%BB%AF%B2%E3%A1%A2%CF > %B8%CE%A2%BB%AE%BA%DB%A1%A2%CE%DB > %B9%B8%A1%A2%C1%A4%C7%E0%B5%C8%A1%A3%BE%AD%BC%F2%B5%A5%B4%A6%C0%ED > %A3%AC%BC%B4%BF%C9%B5%C3%B5%BD%D2%BB%B8%F6%BB%B9%D4%AD > %B9%E2%C1%C1%B5%C4%BE%B5%C3%E6%A1%A3%3C/P%3E%3C/LI%3E > %20%20&langpair=zh-CN|en(819 characters ) > When I test the length of sentenses,I found "1,000 characters" may > point B. > Am I right? > > > > > > Actually,My C# program translate text from Chinese to English.I split > the text to sentense,based on the rules of Chinese sentence cut. > When the parogram request like ' > On 12月9日, 下午8时16分, Jeremy Geerdes <[email protected]> wrote: >> Looking at the example request uri you've shared, I suspect that >> you're running into the problem because the string you're sending is >> not valid html. So the translation engine doesn't recognize it as >> html. So it tries totranslateit and, of course, fails. The real >> question here is why you are breaking your requests into chunks of >> only 180 characters when the API will accept requests well in excess >> of 1,000 characters via the GET interface, and up to 5,000 characters >> via POST. In fact, the API grows increasingly accurate with longer >> strings because of the way machine translation works. At any rate, it >> would be advisable to make sure that you're splitting your strings >> not >> on strict character counts, but on complete sentences and/or clauses. >> And there is no real reason to submit strings that are entirely html >> at all. >> >> Hope this helps. >> >> Jeremy R. Geerdes >> Effective website design & development >> Des Moines, IA >> >> For more information or a project quote:http://jgeerdes.home.mchsi.comhttp >> ://jgeerdes.blogspot.comhttp://jgeerdes.wordpress.com >> [email protected] >> >> Unless otherwise noted, any price quotes contained within this >> communication are given in US dollars. >> >> If you're in the Des Moines, IA, area, check out Debra Heights >> Wesleyan Church! >> >> And check out my blog, Adventures in Web Development, >> athttp://jgeerdes.blogspot.com >> ! >> >> On Dec 9, 2009, at 12:17 AM, J wrote: >> >>> my site provides an automatic translation feature,based on google >>> ajax >>> api service. >> >>> i found abugwhen got request like : >> >>> http://ajax.googleapis.com/ajax/services/language/translate? >>> v=1.0&q=%... >>> |en >> >>> or >> >>> http://ajax.googleapis.com/ajax/services/language/translate? >>> v=1.0&q=><IMG >>> src="http://www.jkc360.com/Upload/20090912131847991&langpair=zh-CN| >>> en >> >>> google gives result: >>> {"responseData": {"translatedText":"\u003chtml\u003e \u0026quot;"}, >>> "responseDetails": null, "responseStatus": 200} >> >>> see,it's abug. >>> my program automatically split the text and submit sections(no more >>> than 180 characters ) to google translation service.when the >>> section >>> includes html code,my program got wrongtranslateresult. >> >>> -- >> >>> You received this message because you are subscribed to the Google >>> Groups "Google AJAX APIs" group. >>> To post to this group, send email to [email protected] >>> . >>> To unsubscribe from this group, send email to >>> [email protected] >>> . >>> For more options, visit this group >>> athttp://groups.google.com/group/google-ajax-search-api?hl=en >>> . > > -- > > You received this message because you are subscribed to the Google > Groups "Google AJAX APIs" group. > To post to this group, send email to [email protected] > . > To unsubscribe from this group, send email to > [email protected] > . > For more options, visit this group at > http://groups.google.com/group/google-ajax-search-api?hl=en > . > > -- You received this message because you are subscribed to the Google Groups "Google AJAX APIs" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-ajax-search-api?hl=en.
