xapian-full-alaveteli 1.2.21.1 → 1.4.11.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 83e17987efda22977dd6d06e033aa6fc02eed954
4
- data.tar.gz: f7ba1616141e4f721dca2161bbe11fc7e6a5e51d
2
+ SHA256:
3
+ metadata.gz: aa0e74a5c6a9b94919b5a4422e5d67a9c4b8dd9c7efbe77d6a2055046b127fe0
4
+ data.tar.gz: 5aebc6cfd88c95a0cf2411fb7f60d4fe969e1c19342e1fd5cf80773bba5391b2
5
5
  SHA512:
6
- metadata.gz: eeaf4c1544774b467821fc3a0455f2adc03c6b77ec0807309e5ce18a8a3291b99a25a0b07e6cd0bd3c56f6908a552b495f9c850bbf5721f3eca056f829f15f81
7
- data.tar.gz: 1323d867c47a5ad35ae29903ab7c667b197860bceaac364cd17edb56c883afecbc5b614d2a12c7d11d1f7fab2996c35ff71025a920f0e19a1d9d109a26040ffc
6
+ metadata.gz: d0a5c64ef8a9828b18f1a9f8b8bad96546098fa1763915d3c3d425ea85f11c8eb8c2676b12001e15c7ed1a135d769ef863cebddca6562613c24f3fcc3a0cd6c3
7
+ data.tar.gz: f852a60d3e923c1f82be28c66155951eb2c191aaa3441d2716fe70c130b03be356bff0fb953553829677fd7972aee8c3f23c1fb616fc3695f35ac058561d2ab8
data/Rakefile CHANGED
@@ -13,7 +13,7 @@ def system!(cmd)
13
13
  system(cmd) or raise
14
14
  end
15
15
 
16
- ver = '1.2.21'
16
+ ver = '1.4.11'
17
17
  core = "xapian-core-#{ver}"
18
18
  bindings = "xapian-bindings-#{ver}"
19
19
 
@@ -37,7 +37,7 @@ task :default do
37
37
  if have_bundler
38
38
  # Maybe Bundler is building us in a temporary directory, and will move us to
39
39
  # the system ruby gems directory once built.
40
- system! "make clean all LDFLAGS='-R#{Bundler.rubygems.gem_dir}/gems/xapian-full-alaveteli-1.2.21.1/lib'"
40
+ system! "make clean all LDFLAGS='-R#{Bundler.rubygems.gem_dir}/gems/xapian-full-alaveteli-1.4.11.1/lib'"
41
41
  else
42
42
  system! "make clean all"
43
43
  end
@@ -4,7 +4,8 @@
4
4
  # Original version by Paul Legato (plegato@nks.net), 4/20/06.
5
5
  #
6
6
  # Copyright (C) 2006 Networked Knowledge Systems, Inc.
7
- # Copyright (C) 2008 Olly Betts
7
+ # Copyright (C) 2008,2011,2019 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
@@ -50,17 +51,17 @@ module Xapian
50
51
  # underlying Iterator
51
52
  def _safelyIterate(dangerousStart, dangerousEnd) #:nodoc:
52
53
  retval = Array.new
53
-
54
+
54
55
  item = dangerousStart
55
56
  lastTerm = dangerousEnd
56
-
57
+
57
58
  return retval if dangerousStart.equals(dangerousEnd)
58
59
 
59
- begin
60
+ begin
60
61
  retval.push(yield(item))
61
62
  item.next()
62
- end while not item.equals(lastTerm) # must use primitive C++ comparator
63
-
63
+ end while not item.equals(lastTerm) # must use primitive C++ comparator
64
+
64
65
  return retval
65
66
  end # _safelyIterate
66
67
  module_function :_safelyIterate
@@ -86,7 +87,7 @@ module Xapian
86
87
  # non-iterative data.
87
88
  # (MSetIterator is not dangerous, but it is inconvenient to use from a Ruby
88
89
  # idiom, so we wrap it..)
89
- class Xapian::Match
90
+ class Xapian::Match
90
91
  attr_accessor :docid, :document, :rank, :weight, :collapse_count, :percent
91
92
 
92
93
  def initialize(docid, document, rank, weight, collapse_count, percent)
@@ -99,10 +100,9 @@ module Xapian
99
100
  end # initialize
100
101
 
101
102
  def ==(other)
102
- return other.is_a?(Xapian::Match) && other.docid == @docid && other.rank == @rank &&
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
128
-
129
- def initialize(value, valueno)
127
+ attr_accessor :value, :valueno, :docid
128
+
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}[https://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
- end # terms
156
+ end # values
153
157
 
154
158
  end # class Xapian::Document
155
159
 
160
+ # Refer to the
161
+ # {Xapian::Query C++ API documentation}[https://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
@@ -161,27 +168,34 @@ module Xapian
161
168
  Xapian::Term.new(item.term, item.wdf)
162
169
  # termfreq is not supported by TermIterators from Queries
163
170
  }
164
- end
171
+ end # terms
165
172
  end # Xapian::Query
166
173
 
174
+ # Refer to the
175
+ # {Xapian::Enquire C++ API documentation}[https://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
170
180
  # Get matching terms for some document.
171
181
  # document can be either a Xapian::DocID or a Xapian::MSetIterator
172
182
  def matching_terms(document)
173
- Xapian._safelyIterate(self._dangerous_matching_terms_begin(document),
183
+ Xapian._safelyIterate(self._dangerous_matching_terms_begin(document),
174
184
  self._dangerous_matching_terms_end(document)) { |item|
175
185
  Xapian::Term.new(item.term, item.wdf)
176
186
  }
177
- end
187
+ end # matching_terms
178
188
  end # Xapian::Enquire
179
189
 
190
+ # Refer to the
191
+ # {Xapian::MSet C++ API documentation}[https://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
183
197
  def matches
184
- Xapian._safelyIterate(self._begin(),
198
+ Xapian._safelyIterate(self._begin(),
185
199
  self._end()) { |item|
186
200
  Xapian::Match.new(item.docid, item.document, item.rank, item.weight, item.collapse_count, item.percent)
187
201
  }
@@ -189,14 +203,18 @@ module Xapian
189
203
  end # matches
190
204
  end # Xapian::MSet
191
205
 
206
+ # Refer to the
207
+ # {Xapian::ESet C++ API documentation}[https://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
195
213
  def terms
196
- Xapian._safelyIterate(self._begin(),
214
+ Xapian._safelyIterate(self._begin(),
197
215
  self._end()) { |item|
198
216
  # note: in the ExpandTerm wrapper, we implicitly rename
199
- # ESetIterator#term() (defined in xapian.i) to ExpandTerm#term()
217
+ # ESetIterator#term() (defined in xapian-headers.i) to ExpandTerm#term()
200
218
  Xapian::ExpandTerm.new(item.term, item.weight)
201
219
  }
202
220
 
@@ -221,13 +239,16 @@ module Xapian
221
239
  end
222
240
  end # Xapian::Posting
223
241
 
242
+ # Refer to the
243
+ # {Xapian::Database C++ API documentation}[https://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
- def allterms
229
- Xapian._safelyIterate(self._dangerous_allterms_begin(),
230
- self._dangerous_allterms_end()) { |item|
249
+ def allterms(pref = '')
250
+ Xapian._safelyIterate(self._dangerous_allterms_begin(pref),
251
+ self._dangerous_allterms_end(pref)) { |item|
231
252
  Xapian::Term.new(item.term, 0, item.termfreq)
232
253
  }
233
254
  end # allterms
@@ -235,10 +256,10 @@ module Xapian
235
256
  # Returns an Array of Xapian::Postings for the given term.
236
257
  # term is a string.
237
258
  def postlist(term)
238
- Xapian._safelyIterate(self._dangerous_postlist_begin(term),
259
+ Xapian._safelyIterate(self._dangerous_postlist_begin(term),
239
260
  self._dangerous_postlist_end(term)) { |item|
240
261
  Xapian::Posting.new(item.docid, item.doclength, item.wdf)
241
- }
262
+ }
242
263
  end # postlist(term)
243
264
 
244
265
  # Returns an Array of Terms for the given docid.
@@ -248,7 +269,6 @@ module Xapian
248
269
  Xapian::Term.new(item.term, item.wdf, item.termfreq)
249
270
  }
250
271
  end # termlist(docid)
251
-
252
272
 
253
273
  # Returns an Array of Xapian::Termpos objects for the given term (a String)
254
274
  # in the given docid.
@@ -259,7 +279,58 @@ 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 # valuestream(slot)
262
290
  end # Xapian::Database
263
291
 
292
+ # Refer to the
293
+ # {Xapian::ValueCountMatchSpy C++ API documentation}[https://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 # values
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 # top_values
313
+ end # Xapian::Database
314
+
315
+ # Refer to the
316
+ # {Xapian::LatLongCoords C++ API documentation}[https://xapian.org/docs/apidoc/html/classXapian_1_1LatLongCoords.html]
317
+ # for methods not specific to Ruby.
318
+ #--
319
+ # Wrap some dangerous iterators.
320
+ class Xapian::LatLongCoords
321
+ # Returns an Array of all the values seen, in alphabetical order
322
+ def all()
323
+ Xapian._safelyIterate(self._begin(),
324
+ self._end()) { |item|
325
+ item.get_coord()
326
+ }
327
+ end # allterms
328
+ end # Xapian::LatLongCoords
329
+
330
+ # Compatibility wrapping for Xapian::BAD_VALUENO (wrapped as a constant since
331
+ # xapian-bindings 1.4.10).
332
+ def Xapian::BAD_VALUENO()
333
+ return Xapian::BAD_VALUENO
334
+ end
264
335
 
265
336
  end # Xapian module
Binary file
@@ -2,24 +2,25 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{xapian-full-alaveteli}
5
- s.version = "1.2.21.1"
5
+ s.version = "1.4.11.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
- s.authors = ["Tom Adams", "Rich Lane", "Seb Bacon", "Alexey Pisarenko", "Louise Crow", "Ian Chard"]
9
- s.date = %q{2015-06-17}
8
+ s.authors = ["Tom Adams", "Rich Lane", "Seb Bacon", "Alexey Pisarenko", "Louise Crow", "Ian Chard", "Sam Pearson"]
9
+ s.homepage = %q{https://github.com/mysociety/xapian-full}
10
+ s.date = %q{2020-05-20}
10
11
  s.description = %q{Xapian bindings for Ruby without dependency on system Xapian library}
11
- s.email = %q{louise@mysociety.org}
12
+ s.email = %q{mysociety@alaveteli.org}
12
13
  s.extensions = ["Rakefile"]
13
14
  s.files = [
14
15
  "lib/xapian.rb",
15
16
  "Rakefile",
16
- "xapian-bindings-1.2.21.tar.xz",
17
- "xapian-core-1.2.21.tar.xz",
17
+ "xapian-bindings-1.4.11.tar.xz",
18
+ "xapian-core-1.4.11.tar.xz",
18
19
  "xapian-full.gemspec",
19
20
  ]
20
21
  s.rdoc_options = ["--charset=UTF-8"]
21
22
  s.require_paths = ["lib"]
22
- s.rubygems_version = %q{1.3.3}
23
+ s.required_ruby_version = ">= 2.1.0"
23
24
  s.summary = %q{xapian-core + Ruby xapian-bindings}
24
25
 
25
26
  if s.respond_to? :specification_version then
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xapian-full-alaveteli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.21.1
4
+ version: 1.4.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Adams
@@ -10,13 +10,14 @@ authors:
10
10
  - Alexey Pisarenko
11
11
  - Louise Crow
12
12
  - Ian Chard
13
+ - Sam Pearson
13
14
  autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
- date: 2015-06-17 00:00:00.000000000 Z
17
+ date: 2020-05-20 00:00:00.000000000 Z
17
18
  dependencies: []
18
19
  description: Xapian bindings for Ruby without dependency on system Xapian library
19
- email: louise@mysociety.org
20
+ email: mysociety@alaveteli.org
20
21
  executables: []
21
22
  extensions:
22
23
  - Rakefile
@@ -24,30 +25,29 @@ extra_rdoc_files: []
24
25
  files:
25
26
  - Rakefile
26
27
  - lib/xapian.rb
27
- - xapian-bindings-1.2.21.tar.xz
28
- - xapian-core-1.2.21.tar.xz
28
+ - xapian-bindings-1.4.11.tar.xz
29
+ - xapian-core-1.4.11.tar.xz
29
30
  - xapian-full.gemspec
30
- homepage:
31
+ homepage: https://github.com/mysociety/xapian-full
31
32
  licenses: []
32
33
  metadata: {}
33
34
  post_install_message:
34
35
  rdoc_options:
35
- - --charset=UTF-8
36
+ - "--charset=UTF-8"
36
37
  require_paths:
37
38
  - lib
38
39
  required_ruby_version: !ruby/object:Gem::Requirement
39
40
  requirements:
40
- - - '>='
41
+ - - ">="
41
42
  - !ruby/object:Gem::Version
42
- version: '0'
43
+ version: 2.1.0
43
44
  required_rubygems_version: !ruby/object:Gem::Requirement
44
45
  requirements:
45
- - - '>='
46
+ - - ">="
46
47
  - !ruby/object:Gem::Version
47
48
  version: '0'
48
49
  requirements: []
49
- rubyforge_project:
50
- rubygems_version: 2.4.6
50
+ rubygems_version: 3.0.3
51
51
  signing_key:
52
52
  specification_version: 3
53
53
  summary: xapian-core + Ruby xapian-bindings
Binary file