问题标签 [wikipedia]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
3 回答
3183 浏览

php - 帮助 PHP 中的正则表达式(解析维基百科标记)

我有这段文字,我想从我从维基百科获取的页面中删除。

以下部分我也希望保留为纯文本(但不包括用“{{”和“}}”包裹的部分

谢谢。

0 投票
5 回答
8756 浏览

wiki - 在哪里可以找到“无错误”的 html 到 wiki 转换器

在谷歌搜索时。我偶然发现了似乎可以完成这项工作的 html2wiki(将在完成发布 Q 后尝试)。但是,除此之外,在查询会话期间还会弹出许多其他选项。

一个词选择哪个应用程序将不胜感激!

谢谢

0 投票
1 回答
165 浏览

iphone - 我在哪里可以找到开源 Wikipedia iPhone 应用程序的源代码?

我在哪里可以找到开源 Wikipedia iPhone 应用程序的源代码?

0 投票
1 回答
1152 浏览

python - 当我尝试将 mwclient 模块用于 Python 时,为什么会出现错误“无法导入名称扫描程序”?

我正在使用 Python 2.5.2(因为 mwclient 仍然只适用于 2.x)。我已将 mwclient 文件夹复制到 /usr/lib/python2.5/site-packages/mwclient 文件夹中,当我运行导入 mwclient 的程序时,我得到以下信息:

扫描仪发现存在于文件 decoder.py 中,所以我无法弄清楚可能出了什么问题。

我不打算使用 mwclient,但我想要一些能尽可能解析出 mediawiki 和 HTMl 标签的东西。我正在寻找纯文本来训练我的语言检测程序。

0 投票
6 回答
19177 浏览

java - 如何爬取整个维基百科?

我试过 WebSphinx 应用程序。

我意识到如果我将 wikipedia.org 作为起始 URL,它就不会进一步爬网。

因此,如何真正爬取整个维基百科?任何人都可以给一些指导吗?我是否需要专门去查找这些 URL 并放置多个起始 URL?

任何人都有关于usng WebSphinx API 教程的好网站的建议吗?

0 投票
1 回答
237 浏览

java - Java 6 中的 VB 支持?

我在 wikipedia 中查看 Java 语言历史,这一段引起了我的注意:

当前版本 Java SE 6(2006 年 12 月 11 日)——代号 Mustang——与数据库管理器捆绑在一起,便于在 JVM 中使用脚本语言(目前是使用 Mozilla 的 Rhino 引擎的 JavaScript),并支持 Visual Basic 语言

在这种情况下,“Visual Basic 语言支持”到底是什么?

0 投票
2 回答
2286 浏览

nlp - 寻找取自维基百科的 n-gram 数据库

我正在有效地尝试解决与此问题相同的问题:

查找与特定单词相关的单词(特别是物理对象)

减去单词代表物理对象的要求。答案和编辑过的问题似乎表明,一个好的开始是使用维基百科文本作为语料库来构建 n-gram 频率列表。在我开始下载庞大的维基百科转储之前,有谁知道这样的列表是否已经存在?

PS如果上一个问题的原始海报看到了这个,我很想知道你是如何解决这个问题的,因为你的结果看起来很棒:-)

0 投票
1 回答
2320 浏览

javascript - Link terms on page to Wikipedia articles in pure JavaScript

While browsing I came across this blog post about using the Wikipedia API from JavaScript, to link a single search term to it's definition. At the end of the blog post the author mentions possible extensions including:

A plugin which auto links terms to Wikipedia articles.

This fits the bill perfectly for a project requirement I'm working on, but sadly I lack the programming skills to extend the original source code. What I'd like is to have a pure JavaScript snippet I can add to a webpage, that links all the terms on that webpage that have an article on an internal wiki to that wiki.

I know this might be asking for much, but the code looks like it's nearly there, and I'd be willing to add a bounty if anyone will do the remaining work for that virtual credit.. ;) I also suspect this might be of value to a few others, as I've seen similar requests but no working implementation (that's a mere JavaScript (and therefore portable) library/snippet include).

Here's a sample of the original source code, I hope anyone is able to add to this or point me to what I'd need to add if I were to implement this myself (in which case I'll share the code if I manage to put something together).


Update
As pointed out in the comments, both the time it would take to link all words and how to handle multiple word spanning article names were concerns of mine as well..

I'd think starting with single word articles would already cover a large percentage of the use cases, with maybe some performance benefits gained when skipping the 500 most common words in the English language, but still I'm uncertain how feasible this approach will be..

On the upside however this would all be client side, and some delay in linking terms is fully acceptable.

Alternatively searching for terms the mouse is hovering over / selected might be acceptable as well, but I'm unsure if this would decrease or increase complexity..


Update 2

'Pointy' explained below that this functionality could be achieved by altering some fairly standard highlighting scripts, after having obtained a list of article topics from api.php?action=query&list=allpages.
To reinterate: we're using an internal wiki, so the list of articles is likely limited, non ambiguous and domain specific enough to overcome some of the expected problems in matching words.

Since we've had some good suggestions so far, and a few workable ideas, I'm starting a bounty to see if I can get a few answers on this..

0 投票
2 回答
666 浏览

assembly - 查询汇编语言中堆栈指针的使用

我准备在维基百科上发表一篇关于尾递归的文章:http ://en.wikipedia.org/wiki/Tail_call

现在在本文的末尾,示例显示堆栈指针用于访问在汇编伪代码中传递给函数调用的参数。这不是错的吗?我的意思是被调用者通过使用帧指针而不是堆栈指针来访问参数?

0 投票
2 回答
9076 浏览

javascript - 使用 AJAX (XMLHttpRequest) 查询 Wikipedia 的 API

我正在尝试使用 AJAX (XMLHttpRequest) 实现对维基百科 API 的简单请求。如果我在 Firefox 的地址栏中键入 url,我会得到一个整洁的 XML,那里不费吹灰之力。然而,调用完全相同的网址:

返回一个空响应。根据 FireBug,我得到 200 OK 响应,但内容是空的。

我怀疑我可能在 GET http 请求的标头上遗漏了一些东西。

帮助!(谢谢!)