public
Description: A Ruby interface to the Open Calais API (http://opencalais.com)
Homepage: http://calais.rubyforge.org/
Clone URL: git://github.com/abhay/calais.git
calais /
name age message
file .gitignore Mon Jun 08 19:23:26 -0700 2009 jeweler for gem management and yard for docs [Abhay Kumar]
file CHANGELOG.markdown Mon Jun 08 19:49:07 -0700 2009 moved history to changelog and converted to mar... [Abhay Kumar]
file MIT-LICENSE Sat Feb 02 21:35:04 -0800 2008 getting ready for release [abhay]
file README.markdown Fri Sep 18 17:10:27 -0700 2009 adding xslt to readme deplist since nokogiri re... [Abhay Kumar]
file Rakefile Fri Sep 18 11:44:36 -0700 2009 swapping out libxml-ruby for Nokogiri, just bec... [jashkenas]
file VERSION.yml Fri Sep 18 17:11:00 -0700 2009 Version bump to 0.0.8 [Abhay Kumar]
file calais.gemspec Fri Sep 18 17:11:24 -0700 2009 updating gemspec for 0.0.8 [Abhay Kumar]
file init.rb Thu Feb 07 22:34:09 -0800 2008 changes incorporated from http://gitorious.org/... [abhay]
directory lib/ Mon Sep 21 01:13:32 -0700 2009 d'oh. typofix [Abhay Kumar]
directory spec/ Mon Sep 21 00:45:23 -0700 2009 added product disambiguation to discard list [Abhay Kumar]
README.markdown

Calais

A Ruby interface to the Open Calais Web Service

Features

  • Accepts documents in text/plain, text/xml and text/html format.
  • Basic access to the Open Calais API's Enlighten action.
    • Output is RDF representation of input document.
  • Single function ability to extract names, entities and geographies from given text.

Synopsis

This is a very basic wrapper to the Open Calais API. It uses the POST endpoint and currently supports the Enlighten action. Here's a simple call:

Calais.enlighten(
    :content => "The government of the United Kingdom has given corporations like fast food chain McDonald's the right to award high school qualifications to employees who complete a company training program."
    :content_type => :text, 
    :license_id => 'your license id'
)

This is the easiest way to get the RDF-formated response from the OpenCalais service.

If you want to do something more fun like getting all sorts of fun information about a document, you can try this:

Calais.process_document(
    :content => "The government of the United Kingdom has given corporations like fast food chain McDonald's the right to award high school qualifications to employees who complete a company training program.",
    :content_type => :text,
    :license_id => 'your license id'
)

This will return an object containing information extracted from the RDF response.

Requirements

Install

You can install the Calais gem via Rubygems (gem install calais) or by building from source.

Authors

Acknowledgements

  • Paul Legato: Help all around with the new response processor and implementation of the 3.1 API.