开发者

Case Insensitivity on Wikipedia API Calls

I am attempting to add case-insensitivity to my Wikipedia api calls. Wikipedia is case-sensitive in how it names pages. So, http://en.wikipedia.org/wiki/Cat will yield a page about the animal, http://en.wikipedia.org/wiki/CAT will yield a disambiguation page, and http://en.wikipedia.org/wiki/CAt will yield a notification that the page doesn't exist.

My current problem is that I would like to use the API to return pages the same way Wikipedia does. I am currently using the following API call in Python:

"http://en.wikipedia.org/w/index.php?title=" + topic + "&action=render"

When searching on Wikipedia using the GUI's search box, "cat" and "C开发者_运维百科At" will return the page about the animal, while "cAT" and "CAT" will return the disambiguation page.

How can I replicate this behavior through the API?


Case insensitive search is done through the Opensearch API.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜