<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>init.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,8 @@
+== UNRELEASED
+
+* pluginized the library for Rails (via pius: http://gitorious.org/projects/calais-au-rails)
+* added helper methods name entity types from a response (recommendation by pius)
+
 == 0.0.2
 
 * cleanup in the specs</diff>
      <filename>History.txt</filename>
    </modified>
    <modified>
      <diff>@@ -2,6 +2,20 @@ module Calais
   class Name
     attr_accessor :name, :type, :hash, :locations
     
+    TYPES = {
+      &quot;cities&quot;                =&gt; &quot;City&quot;,
+      &quot;companies&quot;             =&gt; &quot;Company&quot;,
+      &quot;continents&quot;            =&gt; &quot;Continent&quot;,
+      &quot;countries&quot;             =&gt; &quot;Country&quot;,
+      &quot;industry_terms&quot;        =&gt; &quot;IndustryTerm&quot;,
+      &quot;money_amounts&quot;         =&gt; &quot;MoneyAmount&quot;,
+      &quot;organizations&quot;         =&gt; &quot;Organization&quot;,
+      &quot;people&quot;                =&gt; &quot;Person&quot;,
+      &quot;provinces_and_states&quot;  =&gt; &quot;ProvinceOrState&quot;,
+      &quot;regions&quot;               =&gt; &quot;Region&quot;,
+      &quot;urls&quot;                  =&gt; &quot;URL&quot;
+    }
+    
     def initialize(args={})
       args.each {|k,v| send(&quot;#{k}=&quot;, v)}
     end</diff>
      <filename>lib/calais/name.rb</filename>
    </modified>
    <modified>
      <diff>@@ -18,6 +18,12 @@ module Calais
       h_doc = parse_relationships(h_doc)
     end
     
+    Name::TYPES.each_pair do |method_name, type|
+      define_method method_name.to_sym do
+        @names.map {|name| name if name.type == type }.compact
+      end
+    end
+    
     private
       def parse_rdf(raw)
         @rdf = CGI::unescapeHTML Hpricot.XML(raw).at(&quot;/string&quot;).inner_html</diff>
      <filename>lib/calais/response.rb</filename>
    </modified>
    <modified>
      <diff>@@ -46,7 +46,7 @@ describe Calais, &quot;.process_document&quot; do
   it &quot;returns names&quot; do
     @response.names.should_not be_nil
     @response.names.should_not be_empty
-    @response.names.map {|n| n.name }.sort.should  == [&quot;Australia&quot;, &quot;Australia&quot;, &quot;Cycling Promotion Fund&quot;, &quot;Ian Christie&quot;, &quot;car manufacturers&quot;, &quot;car market&quot;, &quot;car sales&quot;, &quot;company car&quot;]
+    @response.names.map {|n| n.name }.sort.should  == [&quot;Australia&quot;, &quot;Australia&quot;, &quot;Cycling Promotion Fund&quot;, &quot;Hobart&quot;, &quot;Ian Christie&quot;, &quot;Tasmania&quot;, &quot;car manufacturers&quot;, &quot;car market&quot;, &quot;car sales&quot;, &quot;company car&quot;]
   end
   
   it &quot;returns relationships&quot; do
@@ -75,6 +75,44 @@ describe Calais::Client, &quot;.params_xml&quot; do
   it &quot;returns an xml encoded string&quot; do
     client = Calais::Client.new(:content =&gt; SAMPLE_DOCUMENT, :content_type =&gt; :xml, :license_id =&gt; LICENSE_ID)
     client.send(&quot;params_xml&quot;).should_not be_nil
-    client.send(&quot;params_xml&quot;).should == %[&lt;c:params xmlns:c=\&quot;http://s.opencalais.com/1/pred/\&quot; xmlns:rdf=\&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#\&quot;&gt;&lt;c:processingDirectives c:contentType=\&quot;TEXT/XML\&quot; c:outputFormat=\&quot;XML/RDF\&quot;&gt;&lt;/c:processingDirectives&gt;&lt;c:userDirectives c:allowDistribution=\&quot;false\&quot; c:allowSearch=\&quot;false\&quot; c:externalID=\&quot;4a661f3cd285d43fa4df971e14e623eb51748e27\&quot; c:submitter=\&quot;calais.rb\&quot;&gt;&lt;/c:userDirectives&gt;&lt;c:externalMetadata&gt;&lt;/c:externalMetadata&gt;&lt;/c:params&gt;]
+    client.send(&quot;params_xml&quot;).should == %[&lt;c:params xmlns:c=\&quot;http://s.opencalais.com/1/pred/\&quot; xmlns:rdf=\&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#\&quot;&gt;&lt;c:processingDirectives c:contentType=\&quot;TEXT/XML\&quot; c:outputFormat=\&quot;XML/RDF\&quot;&gt;&lt;/c:processingDirectives&gt;&lt;c:userDirectives c:allowDistribution=\&quot;false\&quot; c:allowSearch=\&quot;false\&quot; c:externalID=\&quot;f14fd3588ba6bfb91a9294240d2d081cfbdc079c\&quot; c:submitter=\&quot;calais.rb\&quot;&gt;&lt;/c:userDirectives&gt;&lt;c:externalMetadata&gt;&lt;/c:externalMetadata&gt;&lt;/c:params&gt;]
   end
+end
+
+describe &quot;a Calais response, @response&quot; do
+  before(:all) do
+    @response = Calais.process_document(:content =&gt; SAMPLE_DOCUMENT, :content_type =&gt; :xml, :license_id =&gt; LICENSE_ID)
+  end
+  
+  it &quot;returns a list of the people Calais identified (@response.people)&quot; do
+    @response.people.should_not be_nil
+    @response.people.should have(1).people
+    @response.people.first.name.should == &quot;Ian Christie&quot;
+  end
+  
+  it &quot;returns a list of the organizations Calais identified (@response.organizations)&quot; do
+    @response.organizations.should_not be_nil
+    @response.should have(1).organizations
+    @response.organizations.first.name.should == &quot;Cycling Promotion Fund&quot;
+  end
+  
+  it &quot;returns a list of the provinces and states Calais identified (@response.provinces_and_states)&quot; do
+    @response.provinces_and_states.should_not be_nil
+    @response.should have(1).provinces_and_states
+    @response.provinces_and_states.first.name.should == &quot;Tasmania&quot;
+  end
+  
+  it &quot;returns a list of the cities Calais identified (@response.cities)&quot; do
+    @response.cities.should_not be_nil
+    @response.should have(1).cities
+    @response.cities.first.name.should == &quot;Hobart&quot;
+  end
+  
+  it &quot;returns a list of the countries Calais identified (@response.countries)&quot; do
+    @response.countries.should_not be_nil
+    @response.should have(1).countries
+    @response.countries.first.name.should == &quot;Australia&quot;
+  end
+  
+  
 end
\ No newline at end of file</diff>
      <filename>spec/calais_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,7 +7,7 @@ Bicycle sales in Australia have recorded record sales of 1,273,781 units for 200
 
 The Cycling Promotion Fund (CPF) spokesman Ian Christie said Australians were increasingly using bicycles as an alternative to cars. Sales rose nine percent in 2006 while the car market stalled. Mr Christie said people were looking to cut their fuel costs and improve their fitness.
 
-Mr Christie said organisations were beginning to supply bicycles as a company vehicle. &quot;There is an emerging trend towards people using bikes as their official company-supplied vehicle in place of the traditional company car,&quot; he said.
+Mr Christie, a native of Hobart, Tasmania said organisations were beginning to supply bicycles as a company vehicle. &quot;There is an emerging trend towards people using bikes as their official company-supplied vehicle in place of the traditional company car,&quot; he said.
 
 &quot;Some of Australia's biggest corporations now have bicycle fleets, and when you add in government organisations, we now know of at least 50 organisations which operate fleets of bikes.&quot;
 </diff>
      <filename>spec/fixtures/bicycles_austrailia.xml</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>a236c62d3cac4b2b506d43d39b7bfc26bfdbd538</id>
    </parent>
  </parents>
  <author>
    <name>Abhay Kumar</name>
    <email>abhay+git@opensynapse.net</email>
  </author>
  <url>http://github.com/abhay/calais/commit/4d9d729def57f6e724f971257cee2a1adfa1ae7e</url>
  <id>4d9d729def57f6e724f971257cee2a1adfa1ae7e</id>
  <committed-date>2008-02-07T22:34:09-08:00</committed-date>
  <authored-date>2008-02-07T22:34:09-08:00</authored-date>
  <message>changes incorporated from http://gitorious.org/projects/calais-au-rails. thanks pius</message>
  <tree>f0887ed415dd2eed19d44902e74ff9225ca912fa</tree>
  <committer>
    <name>Abhay Kumar</name>
    <email>abhay+git@opensynapse.net</email>
  </committer>
</commit>
