Coder Social home page Coder Social logo

wikipedia's Introduction

wikipedia

tool for extracting plain text from wikipedia articles

Installing:

a gem is available, so fire up your terminal:

$ gem install wikipedia

Usage:

it's easy:

irb(main):001:0* require 'wikipedia'
irb(main):002:0>
irb(main):003:0* connor = Wikipedia::article 'John Connor'
irb(main):004:0> connor.first     # just the first paragraph
"John Connor is a fictional character and the main protagonist of the Terminator franchise.
Created by writer and director James Cameron, the character is first referred to in the 1984 film The Terminator 
and first appears, portrayed by teenage actor Edward Furlong, in its 1991 sequel Terminator 2: Judgment Day.
The character is subsequently portrayed by 23-year-old Nick Stahl in the 2003 film Terminator 3: Rise of the Machines
and by 19-year-old Thomas Dekker in the 2007 television series Terminator: The Sarah Connor Chronicles.
English actor Christian Bale portrays Connor in the film series' fourth installment, Terminator Salvation."

There's a simple method for checking term's ambiguity, an array of those other terms will be provided in the future.

A good example is 'apple' which may refer to the company, to the fruit, etc.

irb(main):001:0> require 'wikipedia'
irb(main):002:0> apple = Wikipedia::article 'apple'
irb(main):003:0> apple.ambiguous?
=> true

TODO

  • Integrate it with the [Opensearch API] (http://www.mediawiki.org/wiki/API%3aOpensearch).
  • Provide a method for classifying text based on context (using data from Wikipedia's disambiguation pages).
  • Switch to Nokogiri or provide support for both Nokogiri and Hpricot?

Disclaimer

[Hpricot] (https://github.com/whymirror/hpricot) was used as a tribute to [whytheluckystiff] (http://en.wikipedia.org/wiki/Why_the_lucky_stiff).

License

MIT

wikipedia's People

Contributors

matiasinsaurralde avatar frewsxcv avatar

Stargazers

 avatar Meddy avatar Yufei avatar  avatar  avatar Ricky avatar Sol Crenshaw avatar Nathan  avatar Nahid Hossain avatar Nikita avatar flyeven avatar  avatar Marcelo Elizeche Landó avatar Angus H. avatar Erick Ayllón avatar Pantelis Koukousoulas avatar noa avatar Jack Nguyen avatar Jeroen Visser avatar Alec Brunelle avatar Juanjo Seijas avatar Ivan Aguero avatar willeM_ Van Onsem avatar Harris Novick avatar Daiki Maekawa avatar JT5D avatar Maksym Kolotilkin avatar Carlos Bergen avatar J Potter avatar Harisankar P S avatar

Watchers

Mickael Faivre-Maçon avatar  avatar James Cloos avatar Paul Götze avatar  avatar  avatar nttr-okada avatar  avatar

wikipedia's Issues

Include a user agent

I can't find a user agent definition in this library (I may simply have weak ruby-fu ;p).

The library should include a default user agent that is distinct from the Ruby default, and it should offer users the opportunity to override this with an agent that refers to their use of the library. See the etiquette guidelines.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.