calais 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,79 @@
1
+ require File.join(File.dirname(__FILE__), %w[.. helper])
2
+
3
+ describe Calais::Client, :new do
4
+ it 'accepts arguments as a hash' do
5
+ client = nil
6
+
7
+ lambda { client = Calais::Client.new(:content => SAMPLE_DOCUMENT, :license_id => LICENSE_ID) }.should_not raise_error
8
+
9
+ client.license_id.should == LICENSE_ID
10
+ client.content.should == SAMPLE_DOCUMENT
11
+ end
12
+
13
+ it 'accepts arguments as a block' do
14
+ client = nil
15
+
16
+ lambda {
17
+ client = Calais::Client.new do |c|
18
+ c.content = SAMPLE_DOCUMENT
19
+ c.license_id = LICENSE_ID
20
+ end
21
+ }.should_not raise_error
22
+
23
+ client.license_id.should == LICENSE_ID
24
+ client.content.should == SAMPLE_DOCUMENT
25
+ end
26
+
27
+ it 'should not accept unknown attributes' do
28
+ lambda { Calais::Client.new(:monkey => 'monkey', :license_id => LICENSE_ID) }.should raise_error(NoMethodError)
29
+ end
30
+ end
31
+
32
+ describe Calais::Client, :params_xml do
33
+ it 'returns an xml encoded string' do
34
+ client = Calais::Client.new(:content => SAMPLE_DOCUMENT, :license_id => LICENSE_ID)
35
+ client.params_xml.should == %[<c:params xmlns:c="http://s.opencalais.com/1/pred/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">\n <c:processingDirectives/>\n <c:userDirectives/>\n</c:params>]
36
+
37
+ client.content_type = :xml
38
+ client.output_format = :json
39
+ client.reltag_base_url = 'http://opencalais.com'
40
+ client.calculate_relevance = true
41
+ client.metadata_enables = Calais::KNOWN_ENABLES
42
+ client.metadata_discards = Calais::KNOWN_DISCARDS
43
+ client.allow_distribution = true
44
+ client.allow_search = true
45
+ client.external_id = Digest::SHA1.hexdigest(client.content)
46
+ client.submitter = 'calais.rb'
47
+
48
+ client.params_xml.should == %[<c:params xmlns:c="http://s.opencalais.com/1/pred/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">\n <c:processingDirectives c:contentType="text/xml" c:outputFormat="application/json" c:reltagBaseURL="http://opencalais.com" c:enableMetadataType="GenericRelations" c:discardMetadata="er/Company;er/Geo"/>\n <c:userDirectives c:allowDistribution="true" c:allowSearch="true" c:externalID="1a008b91e7d21962e132bc1d6cb252532116a606" c:submitter="calais.rb"/>\n</c:params>]
49
+ end
50
+ end
51
+
52
+ describe Calais::Client, :enlighten do
53
+ before do
54
+ @client = Calais::Client.new do |c|
55
+ c.content = SAMPLE_DOCUMENT
56
+ c.license_id = LICENSE_ID
57
+ c.content_type = :xml
58
+ c.output_format = :json
59
+ c.calculate_relevance = true
60
+ c.metadata_enables = Calais::KNOWN_ENABLES
61
+ c.allow_distribution = true
62
+ c.allow_search = true
63
+ end
64
+ end
65
+
66
+ it 'provides access to the enlighten command on the generic rest endpoint' do
67
+ @client.should_receive(:do_request).with(anything).and_return(SAMPLE_RESPONSE)
68
+ @client.enlighten
69
+ @client.instance_variable_get(:@client).url.should == Calais::REST_ENDPOINT
70
+ end
71
+
72
+ it 'provides access to the enlighten command on the beta rest endpoint' do
73
+ @client.use_beta = true
74
+
75
+ @client.should_receive(:do_request).with(anything).and_return(SAMPLE_RESPONSE)
76
+ @client.enlighten
77
+ @client.instance_variable_get(:@client).url.should == Calais::BETA_REST_ENDPOINT
78
+ end
79
+ end
@@ -0,0 +1,127 @@
1
+ require File.join(File.dirname(__FILE__), %w[.. helper])
2
+
3
+ describe Calais::Response, :new do
4
+ it 'accepts an rdf string to generate the response object' do
5
+ lambda { Calais::Response.new(SAMPLE_RESPONSE) }.should_not raise_error
6
+ end
7
+ end
8
+
9
+ describe Calais::Response, :new do
10
+ before :all do
11
+ @response = Calais::Response.new(SAMPLE_RESPONSE)
12
+ end
13
+
14
+ it 'should extract document information' do
15
+ @response.language.should == 'English'
16
+ @response.submission_date.should be_a_kind_of(DateTime)
17
+ @response.signature.should == 'digestalg-1|iCEVI2NK1nAAvP+p5uaqnHISxdo=|U3QC5z6ZN1DLUJrqiP6gpTuxrdAxOaVOrjUQVuarCmb+zoqbm2fypA=='
18
+ @response.submitter_code.should == '4a388fbc-9897-def9-9233-efddbfbca363'
19
+ @response.request_id.should == '896ffd83-ad5f-4e4b-892b-4cc337a246af'
20
+ @response.doc_title.should == 'Record number of bicycles sold in Australia in 2006'
21
+ @response.doc_date.should be_a_kind_of(Date)
22
+ end
23
+
24
+ it 'should extract entities' do
25
+ entities = @response.entities
26
+ entities.map { |e| e.type }.sort.uniq.should == %w[City Continent Country IndustryTerm Organization Person ProvinceOrState]
27
+ end
28
+
29
+ it 'should extract relations' do
30
+ relations = @response.relations
31
+ relations.map { |e| e.type }.sort.uniq.should == %w[GenericRelations PersonAttributes PersonProfessional Quotation]
32
+ end
33
+
34
+ it 'should extract geographies' do
35
+ geographies = @response.geographies
36
+ geographies.map { |e| e.name }.sort.uniq.should == %w[Australia Hobart,Tasmania,Australia Tasmania,Australia]
37
+ end
38
+
39
+ it 'should extract relevances' do
40
+ @response.instance_variable_get("@relevances").size.should == 10
41
+ end
42
+
43
+ it 'should assign a floating-point relevance to each entity' do
44
+ @response.entities.each {|e| e.relevance.class.should == Float }
45
+ end
46
+
47
+ it 'should assign the correct relevance to each entity' do
48
+ correct_relevances = {
49
+ "84a34c48-25ac-327f-a805-7b81fd570f7d" => 0.725,
50
+ "9853f11e-5efa-3efc-90b9-0d0450f7d673" => 0.396,
51
+ "9fa3fb8a-f517-32c7-8a46-3c1506ea3a70" => 0.156,
52
+ "ed0e83f9-87e8-3da6-ab46-cd6be116357c" => 0.291,
53
+ "e05f3d33-1622-3172-836c-b48637a156d3" => 0.316,
54
+ "d0ca04b6-9cf5-3595-ad4b-7758a0b57997" => 0.156,
55
+ "0bb9cdb4-3cb7-342a-9901-6d1f12b32f6a" => 0.31,
56
+ "3979e581-0823-3e84-9257-1ca36db4665e" => 0.228,
57
+ "0c3d5340-106f-390e-92d3-a4aa18004fb8" => 0.158,
58
+ "3bcf2655-ff2a-3a80-8de4-558b9626ad21" => 0.644
59
+ }
60
+ @response.entities.each {|e| correct_relevances[e.hash.value].should == e.relevance }
61
+ end
62
+
63
+ it 'should find the correct document categories returned by OpenCalais' do
64
+ @response.categories.map {|c| c.name }.sort.should == %w[Business_Finance Technology_Internet]
65
+ end
66
+
67
+ it 'should find the correct document category scores returned by OpenCalais' do
68
+ @response.categories.map {|c| c.score }.should == [1.0, 1.0]
69
+ end
70
+
71
+ it 'should find instances for each entity' do
72
+ @response.entities.each {|e|
73
+ e.instances.size.should > 0
74
+ }
75
+ end
76
+
77
+
78
+ it 'should find instances for each relation' do
79
+ @response.relations.each {|r|
80
+ r.instances.size.should > 0
81
+ }
82
+ end
83
+
84
+ it 'should find the correct instances for each entity' do
85
+ ## This currently tests only for the "Australia" entity's
86
+ ## instances. A more thorough test that tests for the instances
87
+ ## of each of the many entities in the sample doc is desirable in
88
+ ## the future.
89
+
90
+ australia = @response.entities.select {|e| e.attributes["name"] == "Australia" }.first
91
+ australia.instances.size.should == 3
92
+ instances = australia.instances.sort{|a,b| a.offset <=> b.offset }
93
+
94
+ instances[0].prefix.should == "number of bicycles sold in "
95
+ instances[0].exact.should == "Australia"
96
+ instances[0].suffix.should == " in 2006<\/title>\n<date>January 4,"
97
+ instances[0].offset.should == 67
98
+ instances[0].length.should == 9
99
+
100
+ instances[1].prefix.should == "4, 2007<\/date>\n<body>\nBicycle sales in "
101
+ instances[1].exact.should == "Australia"
102
+ instances[1].suffix.should == " have recorded record sales of 1,273,781 units"
103
+ instances[1].offset.should == 146
104
+ instances[1].length.should == 9
105
+
106
+ instances[2].prefix.should == " the traditional company car,\" he said.\n\n\"Some of "
107
+ instances[2].exact.should == "Australia"
108
+ instances[2].suffix.should == "'s biggest corporations now have bicycle fleets,"
109
+ instances[2].offset.should == 952
110
+ instances[2].length.should == 9
111
+ end
112
+
113
+ it 'should find the correct instances for each relation' do
114
+ ## This currently tests only for one relation's instances. A more
115
+ ## thorough test that tests for the instances of each of the many other
116
+ ## relations in the sample doc is desirable in the future.
117
+
118
+ rel = @response.relations.select {|e| e.hash.value == "8f3936d9-cf6b-37fc-ae0d-a145959ae3b5" }.first
119
+ rel.instances.size.should == 1
120
+
121
+ rel.instances.first.prefix.should == " manufacturers.\n\nThe Cycling Promotion Fund (CPF) "
122
+ rel.instances.first.exact.should == "spokesman Ian Christie said Australians were increasingly using bicycles as an alternative to cars."
123
+ rel.instances.first.suffix.should == " Sales rose nine percent in 2006 while the car"
124
+ rel.instances.first.offset.should == 425
125
+ rel.instances.first.length.should == 99
126
+ end
127
+ end
@@ -1,118 +1,7 @@
1
- require File.expand_path("#{File.dirname(__FILE__)}/helper")
1
+ require File.join(File.dirname(__FILE__), %w[helper])
2
2
 
3
3
  describe Calais do
4
4
  it "provides a version number" do
5
5
  Calais::VERSION.should_not be_nil
6
6
  end
7
- end
8
-
9
- describe Calais::Client, ".new" do
10
- it "accepts arguments as a hash" do
11
- client = nil
12
-
13
- lambda { client = Calais::Client.new(:content => SAMPLE_DOCUMENT, :license_id => LICENSE_ID) }.should_not raise_error(ArgumentError)
14
-
15
- client.license_id.should == LICENSE_ID
16
- client.content.should == SAMPLE_DOCUMENT
17
- end
18
-
19
- it "accepts arguments as a block" do
20
- client = nil
21
-
22
- lambda {
23
- client = Calais::Client.new do |c|
24
- c.content = SAMPLE_DOCUMENT
25
- c.license_id = LICENSE_ID
26
- end
27
- }.should_not raise_error(ArgumentError)
28
-
29
- client.license_id.should == LICENSE_ID
30
- client.content.should == SAMPLE_DOCUMENT
31
- end
32
-
33
- it "should not accept unknown attributes" do
34
- lambda { Calais::Client.new(:monkey => "monkey", :license_id => LICENSE_ID) }.should raise_error(NoMethodError)
35
- end
36
- end
37
-
38
- describe Calais, ".process_document" do
39
- before(:all) { @response = Calais.process_document(:content => SAMPLE_DOCUMENT, :content_type => :xml, :license_id => LICENSE_ID) }
40
-
41
- it "returns a Calais::Response" do
42
- @response.should_not be_nil
43
- @response.should be_a_kind_of(Calais::Response)
44
- end
45
-
46
- it "returns names" do
47
- @response.names.should_not be_nil
48
- @response.names.should_not be_empty
49
- @response.names.map {|n| n.name }.sort.should == ["Australia", "Australia", "Cycling Promotion Fund", "Hobart", "Ian Christie", "Tasmania", "car manufacturers", "car market", "car sales", "company car"]
50
- end
51
-
52
- it "returns relationships" do
53
- @response.relationships.should_not be_nil
54
- @response.relationships.should_not be_empty
55
- @response.relationships.map {|r| r.type }.should == ["Quotation", "Quotation", "PersonProfessional", "Quotation", "Quotation", "Quotation", "Quotation"]
56
- end
57
-
58
- end
59
-
60
- describe Calais::Client, ".call" do
61
- before(:all) do
62
- @client = Calais::Client.new(:content => SAMPLE_DOCUMENT, :license_id => LICENSE_ID)
63
- end
64
-
65
- it "accepts known methods" do
66
- lambda { @client.call('enlighten') }.should_not raise_error(ArgumentError)
67
- end
68
-
69
- it "complains about unkown methods" do
70
- lambda { @client.call('monkey') }.should raise_error(ArgumentError)
71
- end
72
- end
73
-
74
- describe Calais::Client, ".params_xml" do
75
- it "returns an xml encoded string" do
76
- client = Calais::Client.new(:content => SAMPLE_DOCUMENT, :content_type => :xml, :license_id => LICENSE_ID)
77
- client.send("params_xml").should_not be_nil
78
- client.send("params_xml").should == %[<c:params xmlns:c=\"http://s.opencalais.com/1/pred/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"><c:processingDirectives c:contentType=\"TEXT/XML\" c:outputFormat=\"XML/RDF\"></c:processingDirectives><c:userDirectives c:allowDistribution=\"false\" c:allowSearch=\"false\" c:externalID=\"f14fd3588ba6bfb91a9294240d2d081cfbdc079c\" c:submitter=\"calais.rb\"></c:userDirectives><c:externalMetadata></c:externalMetadata></c:params>]
79
- end
80
- end
81
-
82
- describe "a Calais response, @response" do
83
- before(:all) do
84
- @response = Calais.process_document(:content => SAMPLE_DOCUMENT, :content_type => :xml, :license_id => LICENSE_ID)
85
- end
86
-
87
- it "returns a list of the people Calais identified (@response.people)" do
88
- @response.people.should_not be_nil
89
- @response.people.should have(1).people
90
- @response.people.first.name.should == "Ian Christie"
91
- end
92
-
93
- it "returns a list of the organizations Calais identified (@response.organizations)" do
94
- @response.organizations.should_not be_nil
95
- @response.should have(1).organizations
96
- @response.organizations.first.name.should == "Cycling Promotion Fund"
97
- end
98
-
99
- it "returns a list of the provinces and states Calais identified (@response.provinces_and_states)" do
100
- @response.provinces_and_states.should_not be_nil
101
- @response.should have(1).provinces_and_states
102
- @response.provinces_and_states.first.name.should == "Tasmania"
103
- end
104
-
105
- it "returns a list of the cities Calais identified (@response.cities)" do
106
- @response.cities.should_not be_nil
107
- @response.should have(1).cities
108
- @response.cities.first.name.should == "Hobart"
109
- end
110
-
111
- it "returns a list of the countries Calais identified (@response.countries)" do
112
- @response.countries.should_not be_nil
113
- @response.should have(1).countries
114
- @response.countries.first.name.should == "Australia"
115
- end
116
-
117
-
118
7
  end
@@ -0,0 +1,483 @@
1
+ {
2
+ "doc":{
3
+ "info":{
4
+ "document":"<document>\n<id>57831<\/id>\n<title>Record number of bicycles sold in Australia in 2006<\/title>\n<date>January 4, 2007<\/date>\n<body>\nBicycle sales in Australia have recorded record sales of 1,273,781 units for 2006, exceeding car sales by 32 percent. It is the fifth year in a row that the bicycle industry has sold more than one million units, a figure yet to be realised by car manufacturers.\n\nThe 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.\n\nMr Christie, a native of Hobart, Tasmania said organisations were beginning to supply bicycles as a company vehicle. \"There is an emerging trend towards people using bikes as their official company-supplied vehicle in place of the traditional company car,\" he said.\n\n\"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.\"\n\n\"Although the company bicycle is a long way from taking over from the company car, it's an important trend when you consider that nearly half of all cars sold are to company fleets.\"\n\nThe CPF claims most commutes to work are less than 5 kilometres (3 miles) making bicycle travel a viable alternative.\n\n<\/body><\/document>",
5
+ "docTitle":"Record number of bicycles sold in Australia in 2006",
6
+ "docDate":"2007-01-04 00:00:00",
7
+ "allowDistribution":"true",
8
+ "allowSearch":"true",
9
+ "calaisRequestID":"35ef0a3c-43bc-4fe4-afb3-df3ef68583f1",
10
+ "id":"http://id.opencalais.com/FYP3OZuxbUDyQEO42uKnqw"
11
+ },
12
+ "meta":{
13
+ "submitterCode":"4a388fbc-9897-def9-9233-efddbfbca363",
14
+ "signature":"digestalg-1|SFRSBjMAPoJABwWIno9iz+W538c=|YJiy7rmNSET86b1nvSAtZt10VCZj+eeLlGp+vTPkfslM3BcXhy+lDA==",
15
+ "contentType":"text/xml",
16
+ "emVer":"UnifiedIM-DJ",
17
+ "langIdVer":"DefaultLangId",
18
+ "language":"English",
19
+ "processingVer":"CalaisJob01",
20
+ "submissionDate":"2008-11-09 00:16:35.096",
21
+ "messages":[
22
+ ]
23
+ }
24
+ },
25
+ "http://d.opencalais.com/dochash-1/9359fafb-1158-3343-91e3-7f4ed89f3b01/cat/1":{
26
+ "_typeGroup":"topics",
27
+ "category":"http://d.opencalais.com/cat/Calais/BusinessFinance",
28
+ "classifierName":"Calais",
29
+ "categoryName":"Business_Finance",
30
+ "score":1
31
+ },
32
+ "http://d.opencalais.com/dochash-1/9359fafb-1158-3343-91e3-7f4ed89f3b01/cat/2":{
33
+ "_typeGroup":"topics",
34
+ "category":"http://d.opencalais.com/cat/Calais/TechnologyInternet",
35
+ "classifierName":"Calais",
36
+ "categoryName":"Technology_Internet",
37
+ "score":1
38
+ },
39
+ "http://d.opencalais.com/genericHasher-1/84a34c48-25ac-327f-a805-7b81fd570f7d":{
40
+ "_type":"Country",
41
+ "_typeGroup":"entities",
42
+ "name":"Australia",
43
+ "instances":[
44
+ {
45
+ "detection":"[number of bicycles sold in ]Australia[ in 2006<\/title>\n<date>January 4,]",
46
+ "prefix":"number of bicycles sold in",
47
+ "exact":"Australia",
48
+ "suffix":"in 2006<\/title>\n<date>January 4,",
49
+ "offset":67,
50
+ "length":9
51
+ },
52
+ {
53
+ "detection":"[4, 2007<\/date>\n<body>\nBicycle sales in ]Australia[ have recorded record sales of 1,273,781 units]",
54
+ "prefix":"4, 2007<\/date>\n<body>\nBicycle sales in",
55
+ "exact":"Australia",
56
+ "suffix":"have recorded record sales of 1,273,781 units",
57
+ "offset":146,
58
+ "length":9
59
+ },
60
+ {
61
+ "detection":"[ the traditional company car,\" he said.\n\n\"Some of ]Australia['s biggest corporations now have bicycle fleets,]",
62
+ "prefix":"the traditional company car,\" he said.\n\n\"Some of",
63
+ "exact":"Australia",
64
+ "suffix":"'s biggest corporations now have bicycle fleets,",
65
+ "offset":952,
66
+ "length":9
67
+ }
68
+ ],
69
+ "relevance":0.725,
70
+ "resolutions":[
71
+ {
72
+ "name":"Australia",
73
+ "latitude":"-32.345623",
74
+ "longitude":"141.4346"
75
+ }
76
+ ]
77
+ },
78
+ "http://d.opencalais.com/genericHasher-1/8f3936d9-cf6b-37fc-ae0d-a145959ae3b5":{
79
+ "_type":"GenericRelations",
80
+ "_typeGroup":"relations",
81
+ "verb":"say",
82
+ "relationsubject":"http://d.opencalais.com/pershash-1/3bcf2655-ff2a-3a80-8de4-558b9626ad21",
83
+ "relationobject":"Australians were increasingly using bicycles as an alternative to cars",
84
+ "instances":[
85
+ {
86
+ "detection":"[ manufacturers.\n\nThe 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]",
87
+ "prefix":"manufacturers.\n\nThe Cycling Promotion Fund (CPF)",
88
+ "exact":"spokesman Ian Christie said Australians were increasingly using bicycles as an alternative to cars.",
89
+ "suffix":"Sales rose nine percent in 2006 while the car",
90
+ "offset":425,
91
+ "length":99
92
+ }
93
+ ]
94
+ },
95
+ "http://d.opencalais.com/genericHasher-1/9853f11e-5efa-3efc-90b9-0d0450f7d673":{
96
+ "_type":"Organization",
97
+ "_typeGroup":"entities",
98
+ "name":"Cycling Promotion Fund",
99
+ "organizationtype":"N/A",
100
+ "nationality":"N/A",
101
+ "instances":[
102
+ {
103
+ "detection":"[yet to be realised by car manufacturers.\n\nThe ]Cycling Promotion Fund[ (CPF) spokesman Ian Christie said Australians]",
104
+ "prefix":"yet to be realised by car manufacturers.\n\nThe",
105
+ "exact":"Cycling Promotion Fund",
106
+ "suffix":"(CPF) spokesman Ian Christie said Australians",
107
+ "offset":396,
108
+ "length":22
109
+ },
110
+ {
111
+ "detection":"[car manufacturers.\n\nThe Cycling Promotion Fund (]CPF[) spokesman Ian Christie said Australians were]",
112
+ "prefix":"car manufacturers.\n\nThe Cycling Promotion Fund (",
113
+ "exact":"CPF",
114
+ "suffix":") spokesman Ian Christie said Australians were",
115
+ "offset":420,
116
+ "length":3
117
+ },
118
+ {
119
+ "detection":"[of all cars sold are to company fleets.\"\n\nThe ]CPF[ claims most commutes to work are less than 5]",
120
+ "prefix":"of all cars sold are to company fleets.\"\n\nThe",
121
+ "exact":"CPF",
122
+ "suffix":"claims most commutes to work are less than 5",
123
+ "offset":1318,
124
+ "length":3
125
+ }
126
+ ],
127
+ "relevance":0.396,
128
+ "resolutions":[
129
+ ]
130
+ },
131
+ "http://d.opencalais.com/genericHasher-1/9fa3fb8a-f517-32c7-8a46-3c1506ea3a70":{
132
+ "_type":"City",
133
+ "_typeGroup":"entities",
134
+ "name":"Hobart",
135
+ "instances":[
136
+ {
137
+ "detection":"[ improve their fitness.\n\nMr Christie, a native of ]Hobart[, Tasmania said organisations were beginning to]",
138
+ "prefix":"improve their fitness.\n\nMr Christie, a native of",
139
+ "exact":"Hobart",
140
+ "suffix":", Tasmania said organisations were beginning to",
141
+ "offset":701,
142
+ "length":6
143
+ }
144
+ ],
145
+ "relevance":0.156,
146
+ "resolutions":[
147
+ {
148
+ "name":"Hobart,Tasmania,Australia",
149
+ "latitude":"-42.8806",
150
+ "longitude":"147.325"
151
+ }
152
+ ]
153
+ },
154
+ "http://d.opencalais.com/genericHasher-1/b8bfc0f2-35cf-3eae-a98e-ae6d0abf5217":{
155
+ "_type":"Quotation",
156
+ "_typeGroup":"relations",
157
+ "person":"http://d.opencalais.com/pershash-1/3bcf2655-ff2a-3a80-8de4-558b9626ad21",
158
+ "quote":"organisations were beginning to supply bicycles as a company vehicle",
159
+ "instances":[
160
+ {
161
+ "detection":"[ cut their fuel costs and improve their fitness.\n\n]Mr Christie, a native of Hobart, Tasmania said organisations were beginning to supply bicycles as a company vehicle.[ \"There is an emerging trend towards people using]",
162
+ "prefix":"cut their fuel costs and improve their fitness.\n\n",
163
+ "exact":"Mr Christie, a native of Hobart, Tasmania said organisations were beginning to supply bicycles as a company vehicle.",
164
+ "suffix":"\"There is an emerging trend towards people using",
165
+ "offset":676,
166
+ "length":116
167
+ }
168
+ ]
169
+ },
170
+ "http://d.opencalais.com/genericHasher-1/acc62eba-98d2-3481-9e2c-fb775f7e01f3":{
171
+ "_type":"GenericRelations",
172
+ "_typeGroup":"relations",
173
+ "verb":"say",
174
+ "relationsubject":"http://d.opencalais.com/genericHasher-1/d0ca04b6-9cf5-3595-ad4b-7758a0b57997",
175
+ "relationobject":"organisations were beginning to supply bicycles as a company vehicle",
176
+ "instances":[
177
+ {
178
+ "detection":"[ their fitness.\n\nMr Christie, a native of Hobart, ]Tasmania said organisations were beginning to supply bicycles as a company vehicle.[ \"There is an emerging trend towards people using]",
179
+ "prefix":"their fitness.\n\nMr Christie, a native of Hobart,",
180
+ "exact":"Tasmania said organisations were beginning to supply bicycles as a company vehicle.",
181
+ "suffix":"\"There is an emerging trend towards people using",
182
+ "offset":709,
183
+ "length":83
184
+ }
185
+ ]
186
+ },
187
+ "http://d.opencalais.com/genericHasher-1/a882c699-1fac-3e5f-a688-9afb43760fa4":{
188
+ "_type":"PersonAttributes",
189
+ "_typeGroup":"relations",
190
+ "person":"http://d.opencalais.com/pershash-1/3bcf2655-ff2a-3a80-8de4-558b9626ad21",
191
+ "birthplace":"Hobart,Tasmania",
192
+ "gender":"M",
193
+ "instances":[
194
+ {
195
+ "detection":"[ cut their fuel costs and improve their fitness.\n\n]Mr Christie, a native of Hobart, Tasmania[ said organisations were beginning to supply]",
196
+ "prefix":"cut their fuel costs and improve their fitness.\n\n",
197
+ "exact":"Mr Christie, a native of Hobart, Tasmania",
198
+ "suffix":"said organisations were beginning to supply",
199
+ "offset":676,
200
+ "length":41
201
+ }
202
+ ]
203
+ },
204
+ "http://d.opencalais.com/genericHasher-1/ed0e83f9-87e8-3da6-ab46-cd6be116357c":{
205
+ "_type":"IndustryTerm",
206
+ "_typeGroup":"entities",
207
+ "name":"car manufacturers",
208
+ "instances":[
209
+ {
210
+ "detection":"[million units, a figure yet to be realised by ]car manufacturers[.\n\nThe Cycling Promotion Fund (CPF) spokesman Ian]",
211
+ "prefix":"million units, a figure yet to be realised by",
212
+ "exact":"car manufacturers",
213
+ "suffix":".\n\nThe Cycling Promotion Fund (CPF) spokesman Ian",
214
+ "offset":372,
215
+ "length":17
216
+ }
217
+ ],
218
+ "relevance":0.291,
219
+ "resolutions":[
220
+ ]
221
+ },
222
+ "http://d.opencalais.com/genericHasher-1/70d3c1da-ce5c-306c-be9d-9a8a1c8c6e21":{
223
+ "_type":"Quotation",
224
+ "_typeGroup":"relations",
225
+ "person":"http://d.opencalais.com/pershash-1/3bcf2655-ff2a-3a80-8de4-558b9626ad21",
226
+ "quote":"Although the company bicycle is a long way from taking over from the company car, it's an important trend when you consider that nearly half of all cars sold are to company fleets.",
227
+ "instances":[
228
+ {
229
+ "detection":"[organisations which operate fleets of bikes.\"\n\n]\"Although the company bicycle is a long way from taking over from the company car, it's an important trend when you consider that nearly half of all cars sold are to company fleets.\"[\n\nThe CPF claims most commutes to work are less]",
230
+ "prefix":"organisations which operate fleets of bikes.\"\n\n",
231
+ "exact":"\"Although the company bicycle is a long way from taking over from the company car, it's an important trend when you consider that nearly half of all cars sold are to company fleets.\"",
232
+ "suffix":"\n\nThe CPF claims most commutes to work are less",
233
+ "offset":1130,
234
+ "length":182
235
+ }
236
+ ]
237
+ },
238
+ "http://d.opencalais.com/genericHasher-1/e05f3d33-1622-3172-836c-b48637a156d3":{
239
+ "_type":"Continent",
240
+ "_typeGroup":"entities",
241
+ "name":"Australia",
242
+ "instances":[
243
+ {
244
+ "detection":"[number of bicycles sold in ]Australia[ in 2006<\/title>\n<date>January 4,]",
245
+ "prefix":"number of bicycles sold in",
246
+ "exact":"Australia",
247
+ "suffix":"in 2006<\/title>\n<date>January 4,",
248
+ "offset":67,
249
+ "length":9
250
+ }
251
+ ],
252
+ "relevance":0.316,
253
+ "resolutions":[
254
+ ]
255
+ },
256
+ "http://d.opencalais.com/genericHasher-1/d0ca04b6-9cf5-3595-ad4b-7758a0b57997":{
257
+ "_type":"ProvinceOrState",
258
+ "_typeGroup":"entities",
259
+ "name":"Tasmania",
260
+ "instances":[
261
+ {
262
+ "detection":"[ their fitness.\n\nMr Christie, a native of Hobart, ]Tasmania[ said organisations were beginning to supply]",
263
+ "prefix":"their fitness.\n\nMr Christie, a native of Hobart,",
264
+ "exact":"Tasmania",
265
+ "suffix":"said organisations were beginning to supply",
266
+ "offset":709,
267
+ "length":8
268
+ }
269
+ ],
270
+ "relevance":0.156,
271
+ "resolutions":[
272
+ {
273
+ "name":"Tasmania,Australia",
274
+ "latitude":"-42.0",
275
+ "longitude":"147.0"
276
+ }
277
+ ]
278
+ },
279
+ "http://d.opencalais.com/genericHasher-1/0bb9cdb4-3cb7-342a-9901-6d1f12b32f6a":{
280
+ "_type":"IndustryTerm",
281
+ "_typeGroup":"entities",
282
+ "name":"car sales",
283
+ "instances":[
284
+ {
285
+ "detection":"[sales of 1,273,781 units for 2006, exceeding ]car sales[ by 32 percent. It is the fifth year in a row]",
286
+ "prefix":"sales of 1,273,781 units for 2006, exceeding",
287
+ "exact":"car sales",
288
+ "suffix":"by 32 percent. It is the fifth year in a row",
289
+ "offset":222,
290
+ "length":9
291
+ }
292
+ ],
293
+ "relevance":0.31,
294
+ "resolutions":[
295
+ ]
296
+ },
297
+ "http://d.opencalais.com/genericHasher-1/3979e581-0823-3e84-9257-1ca36db4665e":{
298
+ "_type":"IndustryTerm",
299
+ "_typeGroup":"entities",
300
+ "name":"car market",
301
+ "instances":[
302
+ {
303
+ "detection":"[cars. Sales rose nine percent in 2006 while the ]car market[ stalled. Mr Christie said people were looking to]",
304
+ "prefix":"cars. Sales rose nine percent in 2006 while the",
305
+ "exact":"car market",
306
+ "suffix":"stalled. Mr Christie said people were looking to",
307
+ "offset":567,
308
+ "length":10
309
+ }
310
+ ],
311
+ "relevance":0.228,
312
+ "resolutions":[
313
+ ]
314
+ },
315
+ "http://d.opencalais.com/genericHasher-1/0c3d5340-106f-390e-92d3-a4aa18004fb8":{
316
+ "_type":"IndustryTerm",
317
+ "_typeGroup":"entities",
318
+ "name":"company car",
319
+ "instances":[
320
+ {
321
+ "detection":"[company-supplied vehicle in place of the ]traditional company car[,\" he said.\n\n\"Some of Australia's biggest]",
322
+ "prefix":"company-supplied vehicle in place of the",
323
+ "exact":"traditional company car",
324
+ "suffix":",\" he said.\n\n\"Some of Australia's biggest",
325
+ "offset":907,
326
+ "length":23
327
+ },
328
+ {
329
+ "detection":"[bicycle is a long way from taking over from the ]company car[, it's an important trend when you consider that]",
330
+ "prefix":"bicycle is a long way from taking over from the",
331
+ "exact":"company car",
332
+ "suffix":", it's an important trend when you consider that",
333
+ "offset":1200,
334
+ "length":11
335
+ }
336
+ ],
337
+ "relevance":0.158,
338
+ "resolutions":[
339
+ ]
340
+ },
341
+ "http://d.opencalais.com/pershash-1/3bcf2655-ff2a-3a80-8de4-558b9626ad21":{
342
+ "_type":"Person",
343
+ "_typeGroup":"entities",
344
+ "name":"Ian Christie",
345
+ "persontype":"political",
346
+ "nationality":"N/A",
347
+ "instances":[
348
+ {
349
+ "detection":"[Cycling Promotion Fund (CPF) spokesman ]Ian Christie[ said Australians were increasingly using]",
350
+ "prefix":"Cycling Promotion Fund (CPF) spokesman",
351
+ "exact":"Ian Christie",
352
+ "suffix":"said Australians were increasingly using",
353
+ "offset":435,
354
+ "length":12
355
+ },
356
+ {
357
+ "detection":"[percent in 2006 while the car market stalled. ]Mr Christie[ said people were looking to cut their fuel costs]",
358
+ "prefix":"percent in 2006 while the car market stalled.",
359
+ "exact":"Mr Christie",
360
+ "suffix":"said people were looking to cut their fuel costs",
361
+ "offset":587,
362
+ "length":11
363
+ },
364
+ {
365
+ "detection":"[ cut their fuel costs and improve their fitness.\n\n]Mr Christie[, a native of Hobart, Tasmania said organisations]",
366
+ "prefix":"cut their fuel costs and improve their fitness.\n\n",
367
+ "exact":"Mr Christie",
368
+ "suffix":", a native of Hobart, Tasmania said organisations",
369
+ "offset":676,
370
+ "length":11
371
+ },
372
+ {
373
+ "detection":"[in place of the traditional company car,\" ]he[ said.\n\n\"Some of Australia's biggest corporations]",
374
+ "prefix":"in place of the traditional company car,\"",
375
+ "exact":"he",
376
+ "suffix":"said.\n\n\"Some of Australia's biggest corporations",
377
+ "offset":933,
378
+ "length":2
379
+ }
380
+ ],
381
+ "relevance":0.644,
382
+ "resolutions":[
383
+ ]
384
+ },
385
+ "http://d.opencalais.com/genericHasher-1/1c2b9a9a-4991-305c-aefe-c724314a7042":{
386
+ "_type":"Quotation",
387
+ "_typeGroup":"relations",
388
+ "person":"http://d.opencalais.com/pershash-1/3bcf2655-ff2a-3a80-8de4-558b9626ad21",
389
+ "quote":"There is an emerging trend towards people using bikes as their official company-supplied vehicle in place of the traditional company car; 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.",
390
+ "instances":[
391
+ {
392
+ "detection":"[to supply bicycles as a company vehicle. ]\"There is an emerging trend towards people using bikes as their official company-supplied vehicle in place of the traditional company car,\" he said.\n\n\"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.\"[\n\n\"Although the company bicycle is a long way]",
393
+ "prefix":"to supply bicycles as a company vehicle.",
394
+ "exact":"\"There is an emerging trend towards people using bikes as their official company-supplied vehicle in place of the traditional company car,\" he said.\n\n\"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.\"",
395
+ "suffix":"\n\n\"Although the company bicycle is a long way",
396
+ "offset":793,
397
+ "length":335
398
+ }
399
+ ]
400
+ },
401
+ "http://d.opencalais.com/genericHasher-1/21431161-7b9f-34c0-9417-9f9b72ed8a70":{
402
+ "_type":"GenericRelations",
403
+ "_typeGroup":"relations",
404
+ "verb":"say",
405
+ "relationsubject":"http://d.opencalais.com/pershash-1/3bcf2655-ff2a-3a80-8de4-558b9626ad21",
406
+ "relationobject":"people were looking to cut their fuel costs and improve their fitness",
407
+ "instances":[
408
+ {
409
+ "detection":"[percent in 2006 while the car market stalled. ]Mr Christie said people were looking to cut their fuel costs and improve their fitness.[\n\nMr Christie, a native of Hobart, Tasmania said]",
410
+ "prefix":"percent in 2006 while the car market stalled.",
411
+ "exact":"Mr Christie said people were looking to cut their fuel costs and improve their fitness.",
412
+ "suffix":"\n\nMr Christie, a native of Hobart, Tasmania said",
413
+ "offset":587,
414
+ "length":87
415
+ }
416
+ ]
417
+ },
418
+ "http://d.opencalais.com/genericHasher-1/7f030b9c-a799-35ce-9eb8-554fcb0b2daf":{
419
+ "_type":"Quotation",
420
+ "_typeGroup":"relations",
421
+ "person":"http://d.opencalais.com/pershash-1/3bcf2655-ff2a-3a80-8de4-558b9626ad21",
422
+ "quote":"people were looking to cut their fuel costs and improve their fitness",
423
+ "instances":[
424
+ {
425
+ "detection":"[percent in 2006 while the car market stalled. ]Mr Christie said people were looking to cut their fuel costs and improve their fitness.[\n\nMr Christie, a native of Hobart, Tasmania said]",
426
+ "prefix":"percent in 2006 while the car market stalled.",
427
+ "exact":"Mr Christie said people were looking to cut their fuel costs and improve their fitness.",
428
+ "suffix":"\n\nMr Christie, a native of Hobart, Tasmania said",
429
+ "offset":587,
430
+ "length":87
431
+ }
432
+ ]
433
+ },
434
+ "http://d.opencalais.com/genericHasher-1/03ebb542-58cd-346f-8cf5-c69cfef1d446":{
435
+ "_type":"GenericRelations",
436
+ "_typeGroup":"relations",
437
+ "verb":"stall",
438
+ "relationsubject":"http://d.opencalais.com/genericHasher-1/3979e581-0823-3e84-9257-1ca36db4665e",
439
+ "instances":[
440
+ {
441
+ "detection":"[to cars. Sales rose nine percent in 2006 while ]the car market stalled[. Mr Christie said people were looking to cut]",
442
+ "prefix":"to cars. Sales rose nine percent in 2006 while",
443
+ "exact":"the car market stalled",
444
+ "suffix":". Mr Christie said people were looking to cut",
445
+ "offset":563,
446
+ "length":22
447
+ }
448
+ ]
449
+ },
450
+ "http://d.opencalais.com/genericHasher-1/39d936c6-79f0-3bcd-9a05-2b36797dc183":{
451
+ "_type":"Quotation",
452
+ "_typeGroup":"relations",
453
+ "person":"http://d.opencalais.com/pershash-1/3bcf2655-ff2a-3a80-8de4-558b9626ad21",
454
+ "quote":"Australians were increasingly using bicycles as an alternative to cars",
455
+ "instances":[
456
+ {
457
+ "detection":"[ figure yet to be realised by car manufacturers.\n\n]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]",
458
+ "prefix":"figure yet to be realised by car manufacturers.\n\n",
459
+ "exact":"The Cycling Promotion Fund (CPF) spokesman Ian Christie said Australians were increasingly using bicycles as an alternative to cars.",
460
+ "suffix":"Sales rose nine percent in 2006 while the car",
461
+ "offset":392,
462
+ "length":132
463
+ }
464
+ ]
465
+ },
466
+ "http://d.opencalais.com/genericHasher-1/cac873f3-52ff-3a09-a8d0-001acb655270":{
467
+ "_type":"PersonProfessional",
468
+ "_typeGroup":"relations",
469
+ "person":"http://d.opencalais.com/pershash-1/3bcf2655-ff2a-3a80-8de4-558b9626ad21",
470
+ "position":"spokesman",
471
+ "organization":"http://d.opencalais.com/genericHasher-1/9853f11e-5efa-3efc-90b9-0d0450f7d673",
472
+ "instances":[
473
+ {
474
+ "detection":"[yet to be realised by car manufacturers.\n\nThe ]Cycling Promotion Fund (CPF) spokesman Ian Christie[ said Australians were increasingly using]",
475
+ "prefix":"yet to be realised by car manufacturers.\n\nThe",
476
+ "exact":"Cycling Promotion Fund (CPF) spokesman Ian Christie",
477
+ "suffix":"said Australians were increasingly using",
478
+ "offset":396,
479
+ "length":51
480
+ }
481
+ ]
482
+ }
483
+ }