retreval 0.1 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,253 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
7
+
8
+ <title>Class: Retreval::ResultDocument</title>
9
+
10
+ <link rel="stylesheet" href="../rdoc.css" type="text/css" media="screen" />
11
+
12
+ <script src="../js/jquery.js" type="text/javascript"
13
+ charset="utf-8"></script>
14
+ <script src="../js/thickbox-compressed.js" type="text/javascript"
15
+ charset="utf-8"></script>
16
+ <script src="../js/quicksearch.js" type="text/javascript"
17
+ charset="utf-8"></script>
18
+ <script src="../js/darkfish.js" type="text/javascript"
19
+ charset="utf-8"></script>
20
+
21
+ </head>
22
+ <body class="class">
23
+
24
+ <div id="metadata">
25
+ <div id="home-metadata">
26
+ <div id="home-section" class="section">
27
+ <h3 class="section-header">
28
+ <a href="../index.html">Home</a>
29
+ <a href="../index.html#classes">Classes</a>
30
+ <a href="../index.html#methods">Methods</a>
31
+ </h3>
32
+ </div>
33
+ </div>
34
+
35
+ <div id="file-metadata">
36
+ <div id="file-list-section" class="section">
37
+ <h3 class="section-header">In Files</h3>
38
+ <div class="section-body">
39
+ <ul>
40
+
41
+ <li><a href="../lib/retreval/query_result_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
42
+ class="thickbox" title="lib/retreval/query_result.rb">lib/retreval/query_result.rb</a></li>
43
+
44
+ </ul>
45
+ </div>
46
+ </div>
47
+
48
+
49
+ </div>
50
+
51
+ <div id="class-metadata">
52
+
53
+ <!-- Parent Class -->
54
+
55
+ <div id="parent-class-section" class="section">
56
+ <h3 class="section-header">Parent</h3>
57
+
58
+ <p class="link"><a href="Document.html">Retreval::Document</a></p>
59
+
60
+ </div>
61
+
62
+
63
+ <!-- Namespace Contents -->
64
+
65
+
66
+ <!-- Method Quickref -->
67
+
68
+ <div id="method-list-section" class="section">
69
+ <h3 class="section-header">Methods</h3>
70
+ <ul class="link-list">
71
+
72
+ <li><a href="#method-c-new">::new</a></li>
73
+
74
+ </ul>
75
+ </div>
76
+
77
+
78
+ <!-- Included Modules -->
79
+
80
+ </div>
81
+
82
+ <div id="project-metadata">
83
+
84
+
85
+ <div id="fileindex-section" class="section project-section">
86
+ <h3 class="section-header">Files</h3>
87
+ <ul>
88
+
89
+ <li class="file"><a href="../CHANGELOG.html">CHANGELOG</a></li>
90
+
91
+ <li class="file"><a href="../TODO.html">TODO</a></li>
92
+
93
+ </ul>
94
+ </div>
95
+
96
+
97
+ <div id="classindex-section" class="section project-section">
98
+ <h3 class="section-header">Class Index
99
+ <span class="search-toggle"><img src="../images/find.png"
100
+ height="16" width="16" alt="[+]"
101
+ title="show/hide quicksearch" /></span></h3>
102
+ <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
103
+ <fieldset>
104
+ <legend>Quicksearch</legend>
105
+ <input type="text" name="quicksearch" value=""
106
+ class="quicksearch-field" />
107
+ </fieldset>
108
+ </form>
109
+
110
+ <ul class="link-list">
111
+
112
+ <li><a href="../Retreval.html">Retreval</a></li>
113
+
114
+ <li><a href="../Retreval/Document.html">Retreval::Document</a></li>
115
+
116
+ <li><a href="../Retreval/GoldStandard.html">Retreval::GoldStandard</a></li>
117
+
118
+ <li><a href="../Retreval/Judgement.html">Retreval::Judgement</a></li>
119
+
120
+ <li><a href="../Retreval/Options.html">Retreval::Options</a></li>
121
+
122
+ <li><a href="../Retreval/Query.html">Retreval::Query</a></li>
123
+
124
+ <li><a href="../Retreval/QueryResult.html">Retreval::QueryResult</a></li>
125
+
126
+ <li><a href="../Retreval/QueryResultSet.html">Retreval::QueryResultSet</a></li>
127
+
128
+ <li><a href="../Retreval/RankedQueryResult.html">Retreval::RankedQueryResult</a></li>
129
+
130
+ <li><a href="../Retreval/ResultDocument.html">Retreval::ResultDocument</a></li>
131
+
132
+ <li><a href="../Retreval/Runner.html">Retreval::Runner</a></li>
133
+
134
+ <li><a href="../Retreval/UnrankedQueryResult.html">Retreval::UnrankedQueryResult</a></li>
135
+
136
+ <li><a href="../Retreval/User.html">Retreval::User</a></li>
137
+
138
+ <li><a href="../TestGoldStandard.html">TestGoldStandard</a></li>
139
+
140
+ <li><a href="../TestQueryResult.html">TestQueryResult</a></li>
141
+
142
+ </ul>
143
+ <div id="no-class-search-results" style="display: none;">No matching classes.</div>
144
+ </div>
145
+
146
+
147
+ </div>
148
+ </div>
149
+
150
+ <div id="documentation">
151
+ <h1 class="class">Retreval::ResultDocument</h1>
152
+
153
+ <div id="description">
154
+ <p>
155
+ A <a href="ResultDocument.html">ResultDocument</a>, in contrast to a <a
156
+ href="Document.html">Document</a>, can also have a score that was
157
+ determined to compute its rank in an information need. The score will only
158
+ be output for informational purposes.
159
+ </p>
160
+
161
+ </div>
162
+
163
+ <!-- Constants -->
164
+
165
+
166
+ <!-- Attributes -->
167
+
168
+ <div id="attribute-method-details" class="method-section section">
169
+ <h3 class="section-header">Attributes</h3>
170
+
171
+
172
+ <div id="score-attribute-method" class="method-detail">
173
+ <a name="score"></a>
174
+
175
+ <div class="method-heading attribute-method-heading">
176
+ <span class="method-name">score</span><span
177
+ class="attribute-access-type">[R]</span>
178
+ </div>
179
+
180
+ <div class="method-description">
181
+
182
+
183
+
184
+ </div>
185
+ </div>
186
+
187
+ </div>
188
+
189
+
190
+ <!-- Methods -->
191
+
192
+ <div id="public-class-method-details" class="method-section section">
193
+ <h3 class="section-header">Public Class Methods</h3>
194
+
195
+
196
+ <div id="new-method" class="method-detail ">
197
+ <a name="method-c-new"></a>
198
+
199
+ <div class="method-heading">
200
+
201
+ <span class="method-name">new</span><span
202
+ class="method-args">(args)</span>
203
+ <span class="method-click-advice">click to toggle source</span>
204
+
205
+ </div>
206
+
207
+ <div class="method-description">
208
+
209
+ <p>
210
+ Creates a new <a href="ResultDocument.html">ResultDocument</a>
211
+ </p>
212
+
213
+
214
+
215
+ <div class="method-source-code"
216
+ id="new-source">
217
+ <pre>
218
+ <span class="ruby-comment cmt"># File lib/retreval/query_result.rb, line 507</span>
219
+ 507: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">args</span>)
220
+ 508: <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">args</span>)
221
+ 509: <span class="ruby-ivar">@score</span> = <span class="ruby-identifier">args</span>[<span class="ruby-value">:score</span>]
222
+ 510: <span class="ruby-keyword kw">end</span></pre>
223
+ </div>
224
+
225
+ </div>
226
+
227
+
228
+
229
+
230
+ </div>
231
+
232
+
233
+ </div>
234
+
235
+
236
+ </div>
237
+
238
+
239
+ <div id="rdoc-debugging-section-dump" class="debugging-section">
240
+
241
+ <p>Disabled; run with --debug to generate this.</p>
242
+
243
+ </div>
244
+
245
+ <div id="validator-badges">
246
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
247
+ <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
248
+ Rdoc Generator</a> 1.1.6</small>.</p>
249
+ </div>
250
+
251
+ </body>
252
+ </html>
253
+
@@ -0,0 +1,506 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
7
+
8
+ <title>Class: Retreval::Runner</title>
9
+
10
+ <link rel="stylesheet" href="../rdoc.css" type="text/css" media="screen" />
11
+
12
+ <script src="../js/jquery.js" type="text/javascript"
13
+ charset="utf-8"></script>
14
+ <script src="../js/thickbox-compressed.js" type="text/javascript"
15
+ charset="utf-8"></script>
16
+ <script src="../js/quicksearch.js" type="text/javascript"
17
+ charset="utf-8"></script>
18
+ <script src="../js/darkfish.js" type="text/javascript"
19
+ charset="utf-8"></script>
20
+
21
+ </head>
22
+ <body class="class">
23
+
24
+ <div id="metadata">
25
+ <div id="home-metadata">
26
+ <div id="home-section" class="section">
27
+ <h3 class="section-header">
28
+ <a href="../index.html">Home</a>
29
+ <a href="../index.html#classes">Classes</a>
30
+ <a href="../index.html#methods">Methods</a>
31
+ </h3>
32
+ </div>
33
+ </div>
34
+
35
+ <div id="file-metadata">
36
+ <div id="file-list-section" class="section">
37
+ <h3 class="section-header">In Files</h3>
38
+ <div class="section-body">
39
+ <ul>
40
+
41
+ <li><a href="../lib/retreval/runner_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
42
+ class="thickbox" title="lib/retreval/runner.rb">lib/retreval/runner.rb</a></li>
43
+
44
+ </ul>
45
+ </div>
46
+ </div>
47
+
48
+
49
+ </div>
50
+
51
+ <div id="class-metadata">
52
+
53
+ <!-- Parent Class -->
54
+
55
+ <div id="parent-class-section" class="section">
56
+ <h3 class="section-header">Parent</h3>
57
+
58
+ <p class="link">Object</p>
59
+
60
+ </div>
61
+
62
+
63
+ <!-- Namespace Contents -->
64
+
65
+
66
+ <!-- Method Quickref -->
67
+
68
+ <div id="method-list-section" class="section">
69
+ <h3 class="section-header">Methods</h3>
70
+ <ul class="link-list">
71
+
72
+ <li><a href="#method-c-new">::new</a></li>
73
+
74
+ <li><a href="#method-i-begin_calculations">#begin_calculations</a></li>
75
+
76
+ <li><a href="#method-i-load_gold_standard">#load_gold_standard</a></li>
77
+
78
+ <li><a href="#method-i-load_query_result_set">#load_query_result_set</a></li>
79
+
80
+ <li><a href="#method-i-run">#run</a></li>
81
+
82
+ <li><a href="#method-i-write_to_yaml_file">#write_to_yaml_file</a></li>
83
+
84
+ </ul>
85
+ </div>
86
+
87
+
88
+ <!-- Included Modules -->
89
+
90
+ </div>
91
+
92
+ <div id="project-metadata">
93
+
94
+
95
+ <div id="fileindex-section" class="section project-section">
96
+ <h3 class="section-header">Files</h3>
97
+ <ul>
98
+
99
+ <li class="file"><a href="../CHANGELOG.html">CHANGELOG</a></li>
100
+
101
+ <li class="file"><a href="../TODO.html">TODO</a></li>
102
+
103
+ </ul>
104
+ </div>
105
+
106
+
107
+ <div id="classindex-section" class="section project-section">
108
+ <h3 class="section-header">Class Index
109
+ <span class="search-toggle"><img src="../images/find.png"
110
+ height="16" width="16" alt="[+]"
111
+ title="show/hide quicksearch" /></span></h3>
112
+ <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
113
+ <fieldset>
114
+ <legend>Quicksearch</legend>
115
+ <input type="text" name="quicksearch" value=""
116
+ class="quicksearch-field" />
117
+ </fieldset>
118
+ </form>
119
+
120
+ <ul class="link-list">
121
+
122
+ <li><a href="../Retreval.html">Retreval</a></li>
123
+
124
+ <li><a href="../Retreval/Document.html">Retreval::Document</a></li>
125
+
126
+ <li><a href="../Retreval/GoldStandard.html">Retreval::GoldStandard</a></li>
127
+
128
+ <li><a href="../Retreval/Judgement.html">Retreval::Judgement</a></li>
129
+
130
+ <li><a href="../Retreval/Options.html">Retreval::Options</a></li>
131
+
132
+ <li><a href="../Retreval/Query.html">Retreval::Query</a></li>
133
+
134
+ <li><a href="../Retreval/QueryResult.html">Retreval::QueryResult</a></li>
135
+
136
+ <li><a href="../Retreval/QueryResultSet.html">Retreval::QueryResultSet</a></li>
137
+
138
+ <li><a href="../Retreval/RankedQueryResult.html">Retreval::RankedQueryResult</a></li>
139
+
140
+ <li><a href="../Retreval/ResultDocument.html">Retreval::ResultDocument</a></li>
141
+
142
+ <li><a href="../Retreval/Runner.html">Retreval::Runner</a></li>
143
+
144
+ <li><a href="../Retreval/UnrankedQueryResult.html">Retreval::UnrankedQueryResult</a></li>
145
+
146
+ <li><a href="../Retreval/User.html">Retreval::User</a></li>
147
+
148
+ <li><a href="../TestGoldStandard.html">TestGoldStandard</a></li>
149
+
150
+ <li><a href="../TestQueryResult.html">TestQueryResult</a></li>
151
+
152
+ </ul>
153
+ <div id="no-class-search-results" style="display: none;">No matching classes.</div>
154
+ </div>
155
+
156
+
157
+ </div>
158
+ </div>
159
+
160
+ <div id="documentation">
161
+ <h1 class="class">Retreval::Runner</h1>
162
+
163
+ <div id="description">
164
+ <p>
165
+ A simple class that performs the task of running this library when called
166
+ from the commandline
167
+ </p>
168
+
169
+ </div>
170
+
171
+ <!-- Constants -->
172
+
173
+
174
+ <!-- Attributes -->
175
+
176
+
177
+ <!-- Methods -->
178
+
179
+ <div id="public-class-method-details" class="method-section section">
180
+ <h3 class="section-header">Public Class Methods</h3>
181
+
182
+
183
+ <div id="new-method" class="method-detail ">
184
+ <a name="method-c-new"></a>
185
+
186
+ <div class="method-heading">
187
+
188
+ <span class="method-name">new</span><span
189
+ class="method-args">(args)</span>
190
+ <span class="method-click-advice">click to toggle source</span>
191
+
192
+ </div>
193
+
194
+ <div class="method-description">
195
+
196
+ <p>
197
+ Invokes a new <a href="Runner.html">Runner</a> object by loading the
198
+ options from the commandline
199
+ </p>
200
+
201
+
202
+
203
+ <div class="method-source-code"
204
+ id="new-source">
205
+ <pre>
206
+ <span class="ruby-comment cmt"># File lib/retreval/runner.rb, line 16</span>
207
+ 16: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">args</span>)
208
+ 17: <span class="ruby-ivar">@options</span> = <span class="ruby-constant">Options</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">args</span>)
209
+ 18: <span class="ruby-keyword kw">end</span></pre>
210
+ </div>
211
+
212
+ </div>
213
+
214
+
215
+
216
+
217
+ </div>
218
+
219
+
220
+ </div>
221
+
222
+ <div id="public-instance-method-details" class="method-section section">
223
+ <h3 class="section-header">Public Instance Methods</h3>
224
+
225
+
226
+ <div id="begin-calculations-method" class="method-detail ">
227
+ <a name="method-i-begin_calculations"></a>
228
+
229
+ <div class="method-heading">
230
+
231
+ <span class="method-name">begin_calculations</span><span
232
+ class="method-args">()</span>
233
+ <span class="method-click-advice">click to toggle source</span>
234
+
235
+ </div>
236
+
237
+ <div class="method-description">
238
+
239
+ <p>
240
+ Performs the default calculations and writes their output to the file
241
+ specified
242
+ </p>
243
+
244
+
245
+
246
+ <div class="method-source-code"
247
+ id="begin-calculations-source">
248
+ <pre>
249
+ <span class="ruby-comment cmt"># File lib/retreval/runner.rb, line 67</span>
250
+ 67: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">begin_calculations</span>
251
+ 68: <span class="ruby-ivar">@statistics</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
252
+ 69: <span class="ruby-ivar">@average_precision</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
253
+ 70:
254
+ 71: <span class="ruby-ivar">@query_result_set</span>.<span class="ruby-identifier">query_results</span>.<span class="ruby-identifier">each_with_index</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">result</span>, <span class="ruby-identifier">index</span><span class="ruby-operator">|</span>
255
+ 72: <span class="ruby-keyword kw">begin</span>
256
+ 73: <span class="ruby-identifier">print</span> <span class="ruby-value str">&quot;Cleaning up results and removing documents without judgements ... \n&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$verbose</span>
257
+ 74: <span class="ruby-identifier">result</span>.<span class="ruby-identifier">cleanup</span>
258
+ 75:
259
+ 76: <span class="ruby-identifier">print</span> <span class="ruby-node">&quot;Calculating statistics for result #{index+1} of #{@query_result_set.query_results.count} ... &quot;</span>
260
+ 77: <span class="ruby-ivar">@statistics</span>[<span class="ruby-identifier">result</span>.<span class="ruby-identifier">query</span>.<span class="ruby-identifier">querystring</span>] = <span class="ruby-identifier">result</span>.<span class="ruby-identifier">statistics</span>
261
+ 78: <span class="ruby-ivar">@average_precision</span>[<span class="ruby-identifier">result</span>.<span class="ruby-identifier">query</span>.<span class="ruby-identifier">querystring</span>] = <span class="ruby-identifier">result</span>.<span class="ruby-identifier">average_precision</span>
262
+ 79: <span class="ruby-identifier">print</span> <span class="ruby-value str">&quot;Done.\n&quot;</span>
263
+ 80:
264
+ 81: <span class="ruby-identifier">result</span>.<span class="ruby-identifier">print_ranked_table</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$verbose</span>
265
+ 82:
266
+ 83: <span class="ruby-identifier">write_to_yaml_file</span> <span class="ruby-value">:data</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@statistics</span>, <span class="ruby-value">:filename</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;statistics.yml&quot;</span>
267
+ 84: <span class="ruby-identifier">write_to_yaml_file</span> <span class="ruby-value">:data</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@average_precision</span>, <span class="ruby-value">:filename</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;avg_precision.yml&quot;</span>
268
+ 85:
269
+ 86: <span class="ruby-comment cmt"># rescue Exception =&gt; e</span>
270
+ 87: <span class="ruby-comment cmt"># raise &quot;Error while calculating results: #{e}&quot;</span>
271
+ 88: <span class="ruby-keyword kw">end</span>
272
+ 89: <span class="ruby-keyword kw">end</span>
273
+ 90:
274
+ 91: <span class="ruby-identifier">print</span> <span class="ruby-value str">&quot;Finished calculating all results. Exiting.\n&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$verbose</span>
275
+ 92: <span class="ruby-identifier">print</span> <span class="ruby-node">&quot;The mean average precision was #{@query_result_set.mean_average_precision}\n&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$verbose</span>
276
+ 93: <span class="ruby-identifier">exit</span>
277
+ 94:
278
+ 95: <span class="ruby-keyword kw">end</span></pre>
279
+ </div>
280
+
281
+ </div>
282
+
283
+
284
+
285
+
286
+ </div>
287
+
288
+
289
+ <div id="load-gold-standard-method" class="method-detail ">
290
+ <a name="method-i-load_gold_standard"></a>
291
+
292
+ <div class="method-heading">
293
+
294
+ <span class="method-name">load_gold_standard</span><span
295
+ class="method-args">()</span>
296
+ <span class="method-click-advice">click to toggle source</span>
297
+
298
+ </div>
299
+
300
+ <div class="method-description">
301
+
302
+ <p>
303
+ Takes the passed options for a <a href="GoldStandard.html">GoldStandard</a>
304
+ file and loads it according to the format specified
305
+ </p>
306
+
307
+
308
+
309
+ <div class="method-source-code"
310
+ id="load-gold-standard-source">
311
+ <pre>
312
+ <span class="ruby-comment cmt"># File lib/retreval/runner.rb, line 21</span>
313
+ 21: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load_gold_standard</span>
314
+ 22: <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">gold_standard_file</span>.<span class="ruby-identifier">nil?</span>
315
+ 23:
316
+ 24:
317
+ 25: <span class="ruby-identifier">print</span> <span class="ruby-node">&quot;Loading gold standard file '#{@options.gold_standard_file}' ... &quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$verbose</span>
318
+ 26: <span class="ruby-ivar">@gold_standard</span> = <span class="ruby-constant">GoldStandard</span>.<span class="ruby-identifier">new</span>
319
+ 27: <span class="ruby-keyword kw">case</span> <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">format</span>
320
+ 28: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;yaml&quot;</span>
321
+ 29: <span class="ruby-ivar">@gold_standard</span>.<span class="ruby-identifier">load_from_yaml_file</span> <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">gold_standard_file</span>
322
+ 30: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;plain&quot;</span>
323
+ 31: <span class="ruby-ivar">@gold_standard</span>.<span class="ruby-identifier">load_from_plaintext_file</span> <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">gold_standard_file</span>
324
+ 32: <span class="ruby-keyword kw">else</span>
325
+ 33: <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;I don't understand the format '#{@options.format}'&quot;</span>
326
+ 34: <span class="ruby-keyword kw">end</span>
327
+ 35:
328
+ 36: <span class="ruby-identifier">print</span> <span class="ruby-value str">&quot;done\n&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$verbose</span>
329
+ 37: <span class="ruby-identifier">print</span> <span class="ruby-node">&quot;Gold standard loaded from #{@options.gold_standard_file} contains:
330
+ 38: - #{@gold_standard.queries.count} queries,
331
+ 39: - #{@gold_standard.documents.count} documents,
332
+ 40: - #{@gold_standard.judgements.count} judgements, made by
333
+ 41: - #{@gold_standard.users.count} users\n\n&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$verbose</span>
334
+ 42: <span class="ruby-keyword kw">end</span>
335
+ 43: <span class="ruby-keyword kw">end</span></pre>
336
+ </div>
337
+
338
+ </div>
339
+
340
+
341
+
342
+
343
+ </div>
344
+
345
+
346
+ <div id="load-query-result-set-method" class="method-detail ">
347
+ <a name="method-i-load_query_result_set"></a>
348
+
349
+ <div class="method-heading">
350
+
351
+ <span class="method-name">load_query_result_set</span><span
352
+ class="method-args">()</span>
353
+ <span class="method-click-advice">click to toggle source</span>
354
+
355
+ </div>
356
+
357
+ <div class="method-description">
358
+
359
+ <p>
360
+ Takes the passed options for a <a
361
+ href="QueryResultSet.html">QueryResultSet</a> file and loads it according
362
+ to the format specified
363
+ </p>
364
+
365
+
366
+
367
+ <div class="method-source-code"
368
+ id="load-query-result-set-source">
369
+ <pre>
370
+ <span class="ruby-comment cmt"># File lib/retreval/runner.rb, line 46</span>
371
+ 46: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load_query_result_set</span>
372
+ 47: <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">query_result_set_file</span>.<span class="ruby-identifier">nil?</span>
373
+ 48:
374
+ 49: <span class="ruby-identifier">print</span> <span class="ruby-node">&quot;Loading query result set from file '#{@options.query_result_set_file}' ... &quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$verbose</span>
375
+ 50: <span class="ruby-ivar">@query_result_set</span> = <span class="ruby-constant">QueryResultSet</span>.<span class="ruby-identifier">new</span> <span class="ruby-value">:gold_standard</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@gold_standard</span>
376
+ 51: <span class="ruby-keyword kw">case</span> <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">format</span>
377
+ 52: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;yaml&quot;</span>
378
+ 53: <span class="ruby-ivar">@query_result_set</span>.<span class="ruby-identifier">load_from_yaml_file</span> <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">query_result_set_file</span>
379
+ 54: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">&quot;plain&quot;</span>
380
+ 55: <span class="ruby-ivar">@query_result_set</span>.<span class="ruby-identifier">load_from_yaml_file</span> <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">query_result_set_file</span>
381
+ 56: <span class="ruby-keyword kw">else</span>
382
+ 57: <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;I don't understand the format '#{@options.format}'&quot;</span>
383
+ 58: <span class="ruby-keyword kw">end</span>
384
+ 59:
385
+ 60: <span class="ruby-identifier">print</span> <span class="ruby-value str">&quot;done\n&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$verbose</span>
386
+ 61: <span class="ruby-identifier">print</span> <span class="ruby-node">&quot;Query results loaded from #{@options.query_result_set_file} contain:
387
+ 62: - #{@query_result_set.query_results.count} query results\n\n&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$verbose</span>
388
+ 63: <span class="ruby-keyword kw">end</span>
389
+ 64: <span class="ruby-keyword kw">end</span></pre>
390
+ </div>
391
+
392
+ </div>
393
+
394
+
395
+
396
+
397
+ </div>
398
+
399
+
400
+ <div id="run-method" class="method-detail ">
401
+ <a name="method-i-run"></a>
402
+
403
+ <div class="method-heading">
404
+
405
+ <span class="method-name">run</span><span
406
+ class="method-args">()</span>
407
+ <span class="method-click-advice">click to toggle source</span>
408
+
409
+ </div>
410
+
411
+ <div class="method-description">
412
+
413
+ <p>
414
+ Called when the script is executed from the command line
415
+ </p>
416
+
417
+
418
+
419
+ <div class="method-source-code"
420
+ id="run-source">
421
+ <pre>
422
+ <span class="ruby-comment cmt"># File lib/retreval/runner.rb, line 113</span>
423
+ 113: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run</span>
424
+ 114:
425
+ 115: <span class="ruby-identifier">load_gold_standard</span>
426
+ 116: <span class="ruby-identifier">load_query_result_set</span>
427
+ 117: <span class="ruby-identifier">begin_calculations</span>
428
+ 118:
429
+ 119: <span class="ruby-keyword kw">end</span></pre>
430
+ </div>
431
+
432
+ </div>
433
+
434
+
435
+
436
+
437
+ </div>
438
+
439
+
440
+ <div id="write-to-yaml-file-method" class="method-detail ">
441
+ <a name="method-i-write_to_yaml_file"></a>
442
+
443
+ <div class="method-heading">
444
+
445
+ <span class="method-name">write_to_yaml_file</span><span
446
+ class="method-args">(args)</span>
447
+ <span class="method-click-advice">click to toggle source</span>
448
+
449
+ </div>
450
+
451
+ <div class="method-description">
452
+
453
+ <p>
454
+ Writes an object to a YAML file. Called by:
455
+ </p>
456
+ <pre>
457
+ write_to_yaml_file :data =&gt; my_data, :filename =&gt; &quot;my_data_file.yml&quot;</pre>
458
+
459
+
460
+
461
+ <div class="method-source-code"
462
+ id="write-to-yaml-file-source">
463
+ <pre>
464
+ <span class="ruby-comment cmt"># File lib/retreval/runner.rb, line 100</span>
465
+ 100: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">write_to_yaml_file</span>(<span class="ruby-identifier">args</span>)
466
+ 101: <span class="ruby-identifier">data</span> = <span class="ruby-identifier">args</span>[<span class="ruby-value">:data</span>]
467
+ 102: <span class="ruby-identifier">filename</span> = <span class="ruby-identifier">args</span>[<span class="ruby-value">:filename</span>]
468
+ 103:
469
+ 104: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">data</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">filename</span>.<span class="ruby-identifier">nil?</span>
470
+ 105: <span class="ruby-identifier">raise</span> <span class="ruby-value str">&quot;Must pass filename and data in order to write to file!&quot;</span>
471
+ 106: <span class="ruby-keyword kw">end</span>
472
+ 107:
473
+ 108: <span class="ruby-identifier">filename</span> = <span class="ruby-ivar">@options</span>.<span class="ruby-identifier">output</span> <span class="ruby-operator">+</span> <span class="ruby-value str">&quot;_&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">filename</span>
474
+ 109: <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">filename</span>, <span class="ruby-value str">&quot;w&quot;</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">write</span> <span class="ruby-identifier">data</span>.<span class="ruby-identifier">to_yaml</span> }
475
+ 110: <span class="ruby-keyword kw">end</span></pre>
476
+ </div>
477
+
478
+ </div>
479
+
480
+
481
+
482
+
483
+ </div>
484
+
485
+
486
+ </div>
487
+
488
+
489
+ </div>
490
+
491
+
492
+ <div id="rdoc-debugging-section-dump" class="debugging-section">
493
+
494
+ <p>Disabled; run with --debug to generate this.</p>
495
+
496
+ </div>
497
+
498
+ <div id="validator-badges">
499
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
500
+ <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
501
+ Rdoc Generator</a> 1.1.6</small>.</p>
502
+ </div>
503
+
504
+ </body>
505
+ </html>
506
+