如何搜索词的定义? [英] How to search for word definitions?

查看:185
本文介绍了如何搜索词的定义?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作在Android上的应用程序,我需要选择一个单词,并显示来自谷歌的定义。我一定要使用由谷歌提供的一些搜索API或其他API?

I am working on a app in android where I need to select a word and display its definition from Google. Do I have to use some search API provided by Google, or another API?

一个例子就可以了。谢谢!

An example will do. Thanks!

推荐答案

这似乎谷歌字典是没有不再可用,但即使它是,这个API是不可用以第三方的。相反,我发现了几个备选方案。

It seems Google Dictionary is no longer available, but even when it was, the API was unavailable to 3rd parties. Instead, I found several alternative options.

您可以使用 XDXF 来的下载您想要的语言平面文件字典,并使用哈希表索引文件正确。

You could use XDXF to download a flat-file dictionary in your desired language, and use a hash table to index the file appropriately.

这具有两个明显的优点:

This has two distinct advantages:


    不需要
  • 网络接入,支持字典查询,UPS

  • Network access is not required to support dictionary look-ups

这是最终更加灵活,因为数据可以很容易被操纵(排序,过滤,特殊格式),以更好地支持应用程序的设计和放大器;要求。

It's ultimately more flexible because the data can be easily manipulated (sorted, filtered, specially formatted) to better support application design & requirements.

如果您preFER不在家酿造自己的哈希表,的 abbreviations.com 的有一个的大众字典API 使用REST获取定义信息以XML格式为给定的字。

If you prefer not to home-brew your own hash-table, abbreviations.com has a public dictionary API that uses REST to obtain definition information in XML format for a given word.

样品申请网址:

http://www.abbreviations.com/services/v1/defs.aspx?tokenid=tk324324&word=consistent 

样响应:

<?xml version="1.0" encoding="UTF-8"?>
<results>
  <result>
    <term>consistent, uniform</term>
    <definition>the same throughout in structure or composition</definition>
    <partofspeech>adj</partofspeech>
    <example>
       bituminous coal is often treated as a consistent and homogeneous product
    </example>
  </result>
</results>

这篇关于如何搜索词的定义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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