NLP Translation

免费增值
通过 gofitech | 已更新 hace 6 días | Translation
人气

9.9 / 10

延迟

3,459ms

服务等级

99%

Health Check

100%

返回所有讨论

There is a problem with the number of Chinese characters

Rapid account: Flytian
flytian
hace 3 años

My English is not good, sorry

There is a problem with the number of Chinese characters

php version of api interface

UTF-8 string “我是中国人”

rawurlencode(“我是中国人”) = %E6%88%91%E6%98%AF%E4%B8%AD%E5%9B%BD%E4%BA%BA

strlen(‘我是中国人’) = 15 characters in length
strlen(’%E6%88%91%E6%98%AF%E4%B8%AD%E5%9B%BD%E4%BA%BA’) = 45 characters in length

Originally, the Chinese characters I submitted were less than 5000 characters in length
The character length after rawurlencode exceeds 5000

Cause the api interface to return an error with characters exceeding 5000

array(2) {
[“status”]=>
int(412)
[“Error”]=>
string(77) “Text with More than 5000 characters or less than one Character is not allowed”
}

Rapid account: Gofitech
gofitech Commented hace 3 años

Hi,

Have you tried using the POST method?

The calculation of the length of the text should be done after the text is decoded.
I’ve tried to translate the text in the example above with GET method and I get the length of the text is 5 in the response.

{ "status": 200, "from": "auto", "to": "en", "original_text": "我是中国人", "translated_text": { "en": "I am Chinese" }, "translated_characters": 5 }

To make the investigation easier, could you send us the full text you want to translate that produces the error?

Thanks

加入讨论 - 在下面添加评论:

登录/注册以发布新的评论