Google翻译REST API,获取名词,形容词等 [英] Google Translate REST API, getting the Nouns, Adjective,ect

查看:197
本文介绍了Google翻译REST API,获取名词,形容词等的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用带有Embarcadero Delphi语言的Google Translate REST API.

I am using the Google Translate REST API with Embarcadero Delphi language.

我为翻​​译通话编写了自己的包装器> https://translation.googleapis.com /language/translate/v2

I wrote my own wrapper for the translate call > https://translation.googleapis.com/language/translate/v2

这非常简单并且可以正常工作.

This was pretty straight forward and works fine.

我唯一的问题是: 当我使用Google的公共网站翻译单词时,将获得一个部分,其中显示与该单词相关的名词/形容词等.

My only question is: When I use the public Google site to translate words, I will get a section that will show Nouns/Adjectives, etc. associated to the word.

示例

דָּוָה的希伯来语(iw)单词翻译成英语(en)

Translate Hebrew (iw) word of דָּוָה into English (en)

我通过API调用和公共"网站获得的翻译后的文本是 "鸽子"就够了.

The translated text I get via the API call and the Public site is "Dove" and that's all.

但是在公共网站上,它会在翻译框下方显示.

But on the public site it shows this below the translation box.

דָוֶה

形容词

生病חוֹלֶה,חוֹלָנִי,חָשׁבְּחִילָה,כּוֹאֵב,דַוָי,דָוֶה

sick חוֹלֶה, חוֹלָנִי, חָשׁ בְּחִילָה, כּוֹאֵב, דַוָי, דָוֶה

悲伤עָצוּב,נוּגֶה,מַעֲצִיב,מְצַעֵר,דַוָי,אָנוּן

sad עָצוּב, נוּגֶה, מַעֲצִיב, מְצַעֵר, דַוָי, אָנוּן

已压缩אוּמלָל,עָלוּב,מִסכֵּן,עָנִי,אֶביוֹן,דָוֶה

wretched אוּמלָל, עָלוּב, מִסכֵּן, עָנִי, אֶביוֹן, דָוֶה

可以通过API获得此信息吗?似乎并非如此.

Is this information obtainable via the API? It doesn't seem so.

我一直在查看文档@ https://cloud.google.com /translate/docs/reference/translate

I have been looking over the docs @ https://cloud.google.com/translate/docs/reference/translate

而且我看不到任何有关这种能力的信息.

and I don't see anything about this ability being exposed.

在这里要了解的是正在发送的JSON和已接收的响应.

To get an idea here is the JSON being sent and the received response.

请求>>>

{
  "q": "\u05d3\u05bc\u05b8\u05d5\u05b8\u05d4",
  "target": "en",
  "format": "text",
  "source": "iw",
  "model": "nmt"
}

<<<响应

<<< Response

{
  "data": {
    "translations": [
      {
        "translatedText": "Dove",
        "model": "nmt"
      }
    ]
  }
}

推荐答案

由于您可以在

Polysemy information is not provided via the API as you can read in the translate method documentation (as you have mentioned in your post) or as you can test using the translation API.

正在寻找与功能请求相关的内容,我发现这一个,尽管并不完全相同,但仍在同一轨道上.您可以对其加注星号,以表示您对该问题感兴趣,该问题用于对平台上的工作进行优先级排序.

Looking for feature requests related, I have found this one which, despite not being exactly the same, is on the same track. You could "star" it to indicate your interest in the issue, which is used to prioritize the work on the platform.

这篇关于Google翻译REST API,获取名词,形容词等的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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