xapian-full 1.1.3.4 → 1.2.3

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ def system!(cmd)
6
6
  system(cmd) or raise
7
7
  end
8
8
 
9
- ver = '1.1.3'
9
+ ver = '1.2.3'
10
10
  core = "xapian-core-#{ver}"
11
11
  bindings = "xapian-bindings-#{ver}"
12
12
  xapian_config = "#{Dir.pwd}/#{core}/xapian-config"
@@ -16,24 +16,26 @@ task :default do
16
16
  system! "tar -xzvf #{x}.tar.gz"
17
17
  end
18
18
 
19
+ prefix = Dir.pwd
20
+ ENV['LDFLAGS'] = "-R#{prefix}/lib"
21
+
22
+ system! "mkdir -p lib"
23
+
19
24
  Dir.chdir core do
20
- system! "./configure"
25
+ system! "./configure --prefix=#{prefix} --exec-prefix=#{prefix}"
21
26
  system! "make clean all"
27
+ system! "cp -r .libs/* ../lib/"
22
28
  end
23
29
 
30
+
31
+
24
32
  Dir.chdir bindings do
25
33
  ENV['RUBY'] ||= "#{c['bindir']}/#{c['RUBY_INSTALL_NAME']}"
26
34
  ENV['XAPIAN_CONFIG'] = xapian_config
27
- system! "./configure --with-ruby"
35
+ system! "./configure --prefix=#{prefix} --exec-prefix=#{prefix} --with-ruby"
28
36
  system! "make clean all"
29
37
  end
30
38
 
31
- system! "mkdir -p lib"
32
- if File.exists? "#{bindings}/ruby/.libs/_xapian.bundle"
33
- system! "cp #{bindings}/ruby/.libs/_xapian.bundle lib"
34
- system! "cp -r #{bindings}/ruby/.libs/_xapian.bundle.dSYM lib"
35
- else
36
- system! "cp #{bindings}/ruby/.libs/_xapian.so lib"
37
- end
39
+ system! "cp -r #{bindings}/ruby/.libs/_xapian.* lib"
38
40
  system! "cp #{bindings}/ruby/xapian.rb lib"
39
41
  end
@@ -5,6 +5,7 @@
5
5
  #
6
6
  # Copyright (C) 2006 Networked Knowledge Systems, Inc.
7
7
  # Copyright (C) 2008 Olly Betts
8
+ # Copyright (C) 2010 Richard Boulton
8
9
  #
9
10
  # This program is free software; you can redistribute it and/or
10
11
  # modify it under the terms of the GNU General Public License as
@@ -102,7 +103,6 @@ module Xapian
102
103
  return other.is_a?(Xapian::Match) && other.docid == @docid && other.rank == @rank &&
103
104
  other.weight == @weight && other.collapse_count == @collapse_count && other.percent == @percent
104
105
  end
105
-
106
106
  end # class Xapian::Match
107
107
 
108
108
  # Ruby wrapper for an ExpandTerm, i.e. a Xapian::ESetIterator in C++
@@ -124,18 +124,22 @@ module Xapian
124
124
 
125
125
  # Ruby wrapper for Xapian::ValueIterator
126
126
  class Xapian::Value
127
- attr_accessor :value, :valueno
127
+ attr_accessor :value, :valueno, :docid
128
128
 
129
- def initialize(value, valueno)
129
+ def initialize(value, valueno, docid)
130
130
  @value = value
131
131
  @valueno = valueno
132
+ @docid = docid
132
133
  end # initialize
133
134
 
134
135
  def ==(other)
135
- return other.is_a?(Xapian::Value) && other.value == @value && other.valueno == @valueno
136
+ return other.is_a?(Xapian::Value) && other.value == @value && other.valueno == @valueno && other.docid == @docid
136
137
  end
137
138
  end # Xapian::Value
138
139
 
140
+ # Refer to the
141
+ # {Xapian::Document C++ API documentation}[http://xapian.org/docs/apidoc/html/classXapian_1_1Document.html]
142
+ # for methods not specific to Ruby.
139
143
  #--
140
144
  # Extend Xapian::Document with a nice wrapper for its nasty input_iterators
141
145
  class Xapian::Document
@@ -147,12 +151,15 @@ module Xapian
147
151
 
148
152
  def values
149
153
  Xapian._safelyIterate(self._dangerous_values_begin(), self._dangerous_values_end()) { |item|
150
- Xapian::Value.new(item.value, item.valueno)
154
+ Xapian::Value.new(item.value, item.valueno, 0)
151
155
  }
152
156
  end # terms
153
157
 
154
158
  end # class Xapian::Document
155
159
 
160
+ # Refer to the
161
+ # {Xapian::Query C++ API documentation}[http://xapian.org/docs/apidoc/html/classXapian_1_1Query.html]
162
+ # for methods not specific to Ruby.
156
163
  #--
157
164
  # Extend Xapian::Query with a nice wrapper for its dangerous iterators
158
165
  class Xapian::Query
@@ -164,6 +171,9 @@ module Xapian
164
171
  end
165
172
  end # Xapian::Query
166
173
 
174
+ # Refer to the
175
+ # {Xapian::Enquire C++ API documentation}[http://xapian.org/docs/apidoc/html/classXapian_1_1Enquire.html]
176
+ # for methods not specific to Ruby.
167
177
  #--
168
178
  # Extend Xapian::Enquire with a nice wrapper for its dangerous iterators
169
179
  class Xapian::Enquire
@@ -177,6 +187,10 @@ module Xapian
177
187
  end
178
188
  end # Xapian::Enquire
179
189
 
190
+ # Refer to the
191
+ # {Xapian::MSet C++ API documentation}[http://xapian.org/docs/apidoc/html/classXapian_1_1MSet.html]
192
+ # for methods not specific to Ruby.
193
+ #--
180
194
  # MSetIterators are not dangerous, just inconvenient to use within a Ruby
181
195
  # programming idiom. So we wrap them.
182
196
  class Xapian::MSet
@@ -189,6 +203,10 @@ module Xapian
189
203
  end # matches
190
204
  end # Xapian::MSet
191
205
 
206
+ # Refer to the
207
+ # {Xapian::ESet C++ API documentation}[http://xapian.org/docs/apidoc/html/classXapian_1_1ESet.html]
208
+ # for methods not specific to Ruby.
209
+ #--
192
210
  # ESetIterators are not dangerous, just inconvenient to use within a Ruby
193
211
  # programming idiom. So we wrap them.
194
212
  class Xapian::ESet
@@ -221,8 +239,11 @@ module Xapian
221
239
  end
222
240
  end # Xapian::Posting
223
241
 
242
+ # Refer to the
243
+ # {Xapian::Database C++ API documentation}[http://xapian.org/docs/apidoc/html/classXapian_1_1Database.html]
244
+ # for methods not specific to Ruby.
224
245
  #--
225
- # Wrap some dangerous iterators..
246
+ # Wrap some dangerous iterators.
226
247
  class Xapian::Database
227
248
  # Returns an Array of all Xapian::Terms for this database.
228
249
  def allterms
@@ -249,7 +270,6 @@ module Xapian
249
270
  }
250
271
  end # termlist(docid)
251
272
 
252
-
253
273
  # Returns an Array of Xapian::Termpos objects for the given term (a String)
254
274
  # in the given docid.
255
275
  def positionlist(docid, term)
@@ -259,7 +279,37 @@ module Xapian
259
279
  }
260
280
  end # positionlist
261
281
 
282
+ # Returns an Array of Xapian::Value objects for the given slot in the
283
+ # database.
284
+ def valuestream(slot)
285
+ Xapian._safelyIterate(self._dangerous_valuestream_begin(slot),
286
+ self._dangerous_valuestream_end(slot)) { |item|
287
+ Xapian::Value.new(item.value, slot, item.docid)
288
+ }
289
+ end # positionlist
262
290
  end # Xapian::Database
263
291
 
292
+ # Refer to the
293
+ # {Xapian::ValueCountMatchSpy C++ API documentation}[http://xapian.org/docs/apidoc/html/classXapian_1_1ValueCountMatchSpy.html]
294
+ # for methods not specific to Ruby.
295
+ #--
296
+ # Wrap some dangerous iterators.
297
+ class Xapian::ValueCountMatchSpy
298
+ # Returns an Array of all the values seen, in alphabetical order
299
+ def values()
300
+ Xapian._safelyIterate(self._dangerous_values_begin(),
301
+ self._dangerous_values_end()) { |item|
302
+ Xapian::Term.new(item.term, 0, item.termfreq)
303
+ }
304
+ end # allterms
305
+
306
+ # Returns an Array of the top values seen, by frequency
307
+ def top_values(maxvalues)
308
+ Xapian._safelyIterate(self._dangerous_top_values_begin(maxvalues),
309
+ self._dangerous_top_values_end(maxvalues)) { |item|
310
+ Xapian::Term.new(item.term, 0, item.termfreq)
311
+ }
312
+ end # allterms
313
+ end # Xapian::Database
264
314
 
265
315
  end # Xapian module
Binary file
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{xapian-full}
5
- s.version = "1.1.3.4"
5
+ s.version = "1.2.3"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Tom Adams", "Rich Lane"]
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
13
13
  s.files = [
14
14
  "lib/xapian.rb",
15
15
  "Rakefile",
16
- "xapian-bindings-1.1.3.tar.gz",
17
- "xapian-core-1.1.3.tar.gz",
16
+ "xapian-bindings-1.2.3.tar.gz",
17
+ "xapian-core-1.2.3.tar.gz",
18
18
  "xapian-full.gemspec",
19
19
  ]
20
20
  s.rdoc_options = ["--charset=UTF-8"]
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xapian-full
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3.4
4
+ prerelease: false
5
+ segments:
6
+ - 1
7
+ - 2
8
+ - 3
9
+ version: 1.2.3
5
10
  platform: ruby
6
11
  authors:
7
12
  - Tom Adams
@@ -25,8 +30,8 @@ extra_rdoc_files: []
25
30
  files:
26
31
  - lib/xapian.rb
27
32
  - Rakefile
28
- - xapian-bindings-1.1.3.tar.gz
29
- - xapian-core-1.1.3.tar.gz
33
+ - xapian-bindings-1.2.3.tar.gz
34
+ - xapian-core-1.2.3.tar.gz
30
35
  - xapian-full.gemspec
31
36
  has_rdoc: true
32
37
  homepage:
@@ -38,21 +43,25 @@ rdoc_options:
38
43
  require_paths:
39
44
  - lib
40
45
  required_ruby_version: !ruby/object:Gem::Requirement
46
+ none: false
41
47
  requirements:
42
48
  - - ">="
43
49
  - !ruby/object:Gem::Version
50
+ segments:
51
+ - 0
44
52
  version: "0"
45
- version:
46
53
  required_rubygems_version: !ruby/object:Gem::Requirement
54
+ none: false
47
55
  requirements:
48
56
  - - ">="
49
57
  - !ruby/object:Gem::Version
58
+ segments:
59
+ - 0
50
60
  version: "0"
51
- version:
52
61
  requirements: []
53
62
 
54
63
  rubyforge_project:
55
- rubygems_version: 1.3.3
64
+ rubygems_version: 1.3.7
56
65
  signing_key:
57
66
  specification_version: 3
58
67
  summary: xapian-core + Ruby xapian-bindings
Binary file
Binary file