Java Swing 项目中的 Google 音译 API
我正在开发一个 Java Swing 的音译项目。它可以访问互联网,但我无法对其进行设置。我们该怎么做呢?我们需要下载 Google API 库还是只需一个函数调用就可以了?
以下是一些有用的音译链接:
Google Transliterate API Devloper指南
(我认为它有Google的所有API库:翻译,音译,搜索等)
我花了很多时间,但我找不到如何设置音译API,不是即使在这样。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
音译 API 似乎已被弃用,并且不包含在 Java 客户端中,仅包含在 JavaScript 客户端中。
JS 库进行的实际调用非常简单,并且可以轻松地从任何地方复制:
不过,不知道这样做是否违反 Google 的条款。大概是这样。
您还可以尝试在 Rhino 中运行 Ajax 客户端。你需要 env-js 它提供了一个纯 javascript DOM 环境。
工作起来简直太可怕了!
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:
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!