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
Search Repo:
added new processing directives. TODO: fix relevance score. It does not 
work right now
abhay (author)
Sun Jul 13 10:31:32 -0700 2008
commit  df864fa71ce5c2ab62bda24fb1a9c54768f0326d
tree    41bdb845857721f823dffbeb148f4ce8aeeaab3e
parent  d1de143b3c971cdf75b601aab2059133369e5ca0
...
3
4
5
 
6
7
8
...
31
32
33
 
 
34
35
36
...
38
39
40
41
 
42
43
44
...
3
4
5
6
7
8
9
...
32
33
34
35
36
37
38
39
...
41
42
43
 
44
45
46
47
0
@@ -3,6 +3,7 @@ module Calais
0
     attr_accessor :license_id
0
     attr_accessor :content
0
     attr_accessor :content_type, :output_format
0
+ attr_accessor :reltag_baseurl, :relevance_score
0
     attr_accessor :allow_distribution, :allow_search, :submitter, :external_id
0
     attr_accessor :external_metadata
0
     
0
@@ -31,6 +32,8 @@ module Calais
0
       def params_xml
0
         content_type = @content_type && AVAILABLE_CONTENT_TYPES.keys.include?(@content_type) ? AVAILABLE_CONTENT_TYPES[@content_type] : AVAILABLE_CONTENT_TYPES[DEFAULT_CONTENT_TYPE]
0
         output_format = @output_format && AVAILABLE_OUTPUT_FORMATS.keys.include?(@output_format) ? AVAILABLE_OUTPUT_FORMATS[@output_format] : AVAILABLE_OUTPUT_FORMATS[DEFAULT_OUTPUT_FORMAT]
0
+ reltag_baseurl = @reltag_baseurl || ""
0
+ relevance_score = @relevance_score ? "true" : "false"
0
         allow_distribution = @allow_distribution ? "true" : "false"
0
         allow_search = @allow_search ? "true" : "false"
0
         submitter = @submitter || DEFAULT_SUBMITTER
0
@@ -38,7 +41,7 @@ module Calais
0
         external_metadata = @external_metadata || ""
0
         
0
         xml = %[<c:params xmlns:c="http://s.opencalais.com/1/pred/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">]
0
- xml += %[<c:processingDirectives c:contentType="#{content_type}" c:outputFormat="#{output_format}"></c:processingDirectives>]
0
+ xml += %[<c:processingDirectives c:contentType="#{content_type}" c:outputFormat="#{output_format}" c:reltagBaseURL="#{reltag_baseurl}" c:calculateRelevanceScore="#{relevance_score}"></c:processingDirectives>]
0
         xml += %[<c:userDirectives c:allowDistribution="#{allow_distribution}" c:allowSearch="#{allow_search}" c:externalID="#{external_id}" c:submitter="#{submitter}"></c:userDirectives>]
0
         xml += %[<c:externalMetadata>#{external_metadata}</c:externalMetadata>]
0
         xml += %[</c:params>]

Comments

    No one has commented yet.