如何检索维基词典的单词内容? [英] How can I retrieve Wiktionary word content?

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

问题描述

如何使用维基词典的 API 来确定一个词是否存在?

How may Wiktionary's API be used to determine whether or not a word exists?

推荐答案

Wiktionary API 可用于查询单词是否存在.

The Wiktionary API can be used to query whether or not a word exists.

现有和不存在页面的示例:

Examples for existing and non-existing pages:

http://en.wiktionary.org/w/api.php?action=query&titles=testhttp://en.wiktionary.org/w/api.php?action=query&titles=testx

第一个链接提供了可能更容易解析的其他类型格式的示例.

The first link provides examples on other types of formats that might be easier to parse.

要以小的 XHTML 格式检索单词的数据(应该不止存在),请请求页面的可打印版本:

To retrieve the word's data in a small XHTML format (should more than existence be required), request the printable version of the page:

http://en.wiktionary.org/w/index.php?title=test&printable=yeshttp://en.wiktionary.org/w/index.php?title=testx&printable=yes

然后可以使用任何标准的 XML 解析器来解析这些.

These can then be parsed with any standard XML parser.

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

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