使用维基百科解疑 [英] disambiguation using wikipedia

查看:117
本文介绍了使用维基百科解疑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用wikipedi的歧义页面做一些歧义。我得到的使用查询从消歧页面链接列表

<$p$p><$c$c>http://en.wikipedia.org/w/api.php?action=query&prop=links&format=json&titles=stack%20overflow_(disambiguation)

我得到的链接好了,但什么是让旁边显示每个链接的文本最快的方法是什么? API不让它一应俱全。我的code的其他部分都在做不可避免地耗费时间的工作,想知道是否有人能提出一些快速的黑客...


解决方案

有没有办法从链接列表转到旁边的文字链接通过API。最迅速(可能只)的办法就是下载页面wikitext的或HTML和解析。

I'm trying to do some disambiguation using wikipedi's disambiguation pages. I get the list of links from the disambiguation page using the query

http://en.wikipedia.org/w/api.php?action=query&prop=links&format=json&titles=stack%20overflow_(disambiguation)

I get the links alright, but what's the speediest way to get the text that appears next to each link? The api doesn't make it readily available. Other parts of my code are doing unavoidably time consuming work, was wondering if anybody could suggest some quick hack ...

解决方案

There is no way to go from "list of links" to "text next to the link" via the API. The speediest (and probably only) way is to download the page wikitext or HTML and parse that.

这篇关于使用维基百科解疑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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