Google transliteration API in Java Swing project

巧了我就是萌 提交于 2020-01-01 06:12:22

问题


I'm working on a transliteration project in Java Swing. It can access the internet, but I'm unable to set it up. How do we do that? Do we need to download the Google API libraries or just a function call will do?

Here are some useful Transliteration links:

The Google Transliterate API Devloper's Guide

Google API library for Java for download

(I think it has all API libraries of Google:Translate, transliterate, search, etc.)

I spent a lot of time, but Icouldn't find how to set up the Transliteration API, not even at SO.


回答1:


Seems the transliteration API is deprecated and is not included in the Java client, only in the JavaScript client.

The actual calls the JS library makes are pretty simple and could easily be replicated from anywhere:

http://www.google.com/inputtools/request?ime=transliteration_en_ru&num=5&cp=0&cs=0&ie=utf-8&oe=utf-8&text=prosto

Don't know if doing that is against Google's terms, though. Probably it is.

You could also try running the Ajax client in Rhino. You'll need env-js which provides a pure javascript DOM environment.

It's just hideous enough to work!



来源:https://stackoverflow.com/questions/9134899/google-transliteration-api-in-java-swing-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!