NLP Translation

FREEMIUM
Durch gofitech | Aktualisiert 4일 전 | Translation
Popularität

9.9 / 10

Latenz

2,407ms

Service Level

99%

Health Check

N/A

Zurück zu allen Diskussionen

There is a problem with the number of Chinese characters

Rapid account: Flytian
flytian
2년 전

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 2년 전

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

Nehmen Sie an der Diskussion teil - fügen Sie unten einen Kommentar hinzu:

Anmelden / Registrieren, um neue Kommentare zu veröffentlichen