Google输入工具“API” - 可以使用吗? [英] Google Input Tools "API" -- can it be used?

查看:196
本文介绍了Google输入工具“API” - 可以使用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到Google通过url接受任何语言的音译和IME请求:

  https://inputtools.google .com / request?text = $& itc = $& num = $ \ 
& cp = 0& cs = 1& ie = utf-8& oe = utf-8& app = test

其中 $ 是一个变量,对于任何语言和文字。

例如,法语(尝试它) p>

  var text =ca me plait,
itc =fr-t-i0-und,
num = 10;
//结果:
[
SUCCESS,
[
[
ca me plait,
[
çameplaît
]
]
]
]

或普通话(试一试):

  var text =shide,
itc =zh-t-i0-pinyin,
num = 5;
//结果:
[
SUCCESS,
[
[
shide,
[
使得,
似的,
是的,
实德,
似地
],
[],
{
注释:[
shi de,
shi de,
shi de,
shi de,
shi de




$ b code>

所有语言都能正常工作并返回很好的建议。问题是我无法在网上找到这个的文档,虽然它看起来像一个API。有人知道是否有官方的Google客户端,或者他们可以接受原始的,未经验证的请求吗?

它可能非官方使用的插件如 jQuery.chineseIME.js ,但是我很感激任何官方的使用信息。

解决方案

无论如何。我创建了自己的插件,将其用于中文,并且可以轻松扩展: https://bitbucket.org/purohit/jquery .intlkeyboard.js


I noticed that Google accepts transliteration and IME requests in any language through the url:

https://inputtools.google.com/request?text=$&itc=$&num=$\
    &cp=0&cs=1&ie=utf-8&oe=utf-8&app=test

where $ is a variable below, for any language and text.

For example, French (try it):

var text = "ca me plait",
    itc = "fr-t-i0-und",
    num = 10;
// Result:
[
    "SUCCESS",
    [
        [
            "ca me plait",
            [
                "ça me plaît"
            ]
        ]
    ]
]

Or, Mandarin (try it):

var text = "shide",
    itc = "zh-t-i0-pinyin",
    num = 5;
// Result: 
[
    "SUCCESS",
    [
        [
            "shide",
            [
                "使得",
                "似的",
                "是的",
                "实德",
                "似地"
            ],
            [],
            {
                "annotation": [
                    "shi de",
                    "shi de",
                    "shi de",
                    "shi de",
                    "shi de"
                ]
            }
        ]
    ]
]

All languages work and return great suggestions. The thing is I can't find documentation for this anywhere on the web, although it clearly looks like an API. Does anyone know if there is an official Google client or if they're okay with raw, unauthenticated requests?

It's used perhaps unofficially by plugins like jQuery.chineseIME.js, but I would appreciate any official usage information.

解决方案

Whatever. I created my own plugin that uses it for Chinese, and can be extended easily: https://bitbucket.org/purohit/jquery.intlkeyboard.js.

这篇关于Google输入工具“API” - 可以使用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆