SpellCheck API请求的错误状态 [英] Error status on SpellCheck API request

查看:79
本文介绍了SpellCheck API请求的错误状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用以下字符串向SpellCheck API发出请求:


"订单shippd by" 


我收到以下错误代码:


{{

  "错误":{

    "code":"BadArgument","
    " message":"查询数组的长度不在有效范围内。"

  }
}}


该请求适用于其他输入,也适用于SpellCheck演示版。

解决方案

您好Tamash,您可以仔细检查请求网址吗?  SpellCheck API中没有查询数组。  WebLM API中有一个(计算*方法)。


你的标准应该是https://api.projectoxford.ai/text/v1.0/spellcheck [?mode]标准形成有效载荷。 结果 我得到:

 {
" spellingErrors":[
{
" offset":7,
" token":" Shippd",
" type":" UnknownToken",
" suggestions":[
{
" token":"运"
}
]
}
]
}






I'm making a request with the following string to the SpellCheck API:

"Orders shippd by" 

and I get the following error code:

{{
  "error": {
    "code": "BadArgument",
    "message": "The length of queries array is not in a valid range."
  }
}}

The request works fine for other inputs and both to the SpellCheck demo version.

解决方案

Hi Tamash, can you double-check the request URL?  There isn't a queries array in the SpellCheck API.  There is one in the WebLM API (calculate* methods).

Yours should be https://api.projectoxford.ai/text/v1.0/spellcheck[?mode] with standard forms payload.  This the result  I get:

{
  "spellingErrors": [
    {
      "offset": 7,
      "token": "Shippd",
      "type": "UnknownToken",
      "suggestions": [
        {
          "token": "shipped"
        }
      ]
    }
  ]
}




这篇关于SpellCheck API请求的错误状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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