abhay / calais

A Ruby interface to the Open Calais API (http://opencalais.com)

This URL has Read+Write access

calais / README.txt
100644 43 lines (26 sloc) 1.833 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
== Calais
A Ruby interface to the Open Calais Web Service (http://opencalais.com)
 
== 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 => 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 => LICENSE_ID)
 
This will return an object containing information extracted from the RDF response.
 
== Requirements
 
* Ruby 1.8.5 or better
  * Uses the following standard libraries: digest/sha1, net/http, yaml, cgi
* libxml2 / libxml-ruby
* curb, libcurl
 
== Install
 
You can install the Calais gem via Rubygems (gem install calais) or by building from source.
 
== Authors
 
Abhay Kumar
http://opensynapse.net
 
== Acknowledgements
 
* Paul Legato (http://www.economaton.com/). Help all around with the new response processor and implementation of the latest API.