isomorfeus-ferret 0.12.7 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (164) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +101 -19
  3. data/README.md +54 -1
  4. data/ext/isomorfeus_ferret_ext/bm_bitvector.c +22 -30
  5. data/ext/isomorfeus_ferret_ext/bm_hash.c +6 -12
  6. data/ext/isomorfeus_ferret_ext/bm_micro_string.c +3 -6
  7. data/ext/isomorfeus_ferret_ext/bm_store.c +11 -22
  8. data/ext/isomorfeus_ferret_ext/brotli_common_dictionary.c +1 -1
  9. data/ext/isomorfeus_ferret_ext/brotli_dec_decode.c +1 -1
  10. data/ext/isomorfeus_ferret_ext/bzip_blocksort.c +1094 -0
  11. data/ext/isomorfeus_ferret_ext/bzip_huffman.c +205 -0
  12. data/ext/isomorfeus_ferret_ext/bzlib.c +1572 -0
  13. data/ext/isomorfeus_ferret_ext/bzlib.h +282 -0
  14. data/ext/isomorfeus_ferret_ext/bzlib_compress.c +672 -0
  15. data/ext/isomorfeus_ferret_ext/bzlib_crctable.c +104 -0
  16. data/ext/isomorfeus_ferret_ext/bzlib_decompress.c +652 -0
  17. data/ext/isomorfeus_ferret_ext/bzlib_private.h +509 -0
  18. data/ext/isomorfeus_ferret_ext/bzlib_randtable.c +84 -0
  19. data/ext/isomorfeus_ferret_ext/fio_tmpfile.h +53 -53
  20. data/ext/isomorfeus_ferret_ext/frb_analysis.c +785 -1192
  21. data/ext/isomorfeus_ferret_ext/frb_index.c +492 -474
  22. data/ext/isomorfeus_ferret_ext/frb_qparser.c +48 -60
  23. data/ext/isomorfeus_ferret_ext/frb_search.c +1520 -1002
  24. data/ext/isomorfeus_ferret_ext/frb_store.c +96 -96
  25. data/ext/isomorfeus_ferret_ext/frb_threading.h +0 -1
  26. data/ext/isomorfeus_ferret_ext/frb_utils.c +147 -196
  27. data/ext/isomorfeus_ferret_ext/frt_analysis.c +695 -1090
  28. data/ext/isomorfeus_ferret_ext/frt_analysis.h +174 -170
  29. data/ext/isomorfeus_ferret_ext/frt_array.c +2 -4
  30. data/ext/isomorfeus_ferret_ext/frt_bitvector.c +9 -16
  31. data/ext/isomorfeus_ferret_ext/frt_bitvector.h +32 -81
  32. data/ext/isomorfeus_ferret_ext/frt_document.c +15 -20
  33. data/ext/isomorfeus_ferret_ext/frt_document.h +10 -10
  34. data/ext/isomorfeus_ferret_ext/frt_except.c +5 -12
  35. data/ext/isomorfeus_ferret_ext/frt_field_index.c +3 -3
  36. data/ext/isomorfeus_ferret_ext/frt_field_index.h +6 -7
  37. data/ext/isomorfeus_ferret_ext/frt_filter.c +35 -46
  38. data/ext/isomorfeus_ferret_ext/frt_fs_store.c +1 -0
  39. data/ext/isomorfeus_ferret_ext/frt_global.c +105 -63
  40. data/ext/isomorfeus_ferret_ext/frt_global.h +7 -3
  41. data/ext/isomorfeus_ferret_ext/frt_hash.c +1 -2
  42. data/ext/isomorfeus_ferret_ext/frt_ind.c +32 -35
  43. data/ext/isomorfeus_ferret_ext/frt_ind.h +9 -9
  44. data/ext/isomorfeus_ferret_ext/frt_index.c +580 -399
  45. data/ext/isomorfeus_ferret_ext/frt_index.h +272 -291
  46. data/ext/isomorfeus_ferret_ext/frt_mempool.c +1 -2
  47. data/ext/isomorfeus_ferret_ext/frt_multimapper.c +4 -7
  48. data/ext/isomorfeus_ferret_ext/frt_q_boolean.c +67 -91
  49. data/ext/isomorfeus_ferret_ext/frt_q_const_score.c +35 -38
  50. data/ext/isomorfeus_ferret_ext/frt_q_filtered_query.c +53 -72
  51. data/ext/isomorfeus_ferret_ext/frt_q_fuzzy.c +25 -32
  52. data/ext/isomorfeus_ferret_ext/frt_q_match_all.c +21 -23
  53. data/ext/isomorfeus_ferret_ext/frt_q_multi_term.c +66 -103
  54. data/ext/isomorfeus_ferret_ext/frt_q_parser.c +207 -195
  55. data/ext/isomorfeus_ferret_ext/frt_q_phrase.c +20 -16
  56. data/ext/isomorfeus_ferret_ext/frt_q_prefix.c +17 -14
  57. data/ext/isomorfeus_ferret_ext/frt_q_range.c +102 -131
  58. data/ext/isomorfeus_ferret_ext/frt_q_span.c +179 -178
  59. data/ext/isomorfeus_ferret_ext/frt_q_term.c +47 -60
  60. data/ext/isomorfeus_ferret_ext/frt_q_wildcard.c +18 -16
  61. data/ext/isomorfeus_ferret_ext/frt_ram_store.c +45 -84
  62. data/ext/isomorfeus_ferret_ext/frt_search.c +105 -146
  63. data/ext/isomorfeus_ferret_ext/frt_search.h +331 -320
  64. data/ext/isomorfeus_ferret_ext/frt_similarity.c +5 -13
  65. data/ext/isomorfeus_ferret_ext/frt_similarity.h +7 -12
  66. data/ext/isomorfeus_ferret_ext/frt_sort.c +105 -149
  67. data/ext/isomorfeus_ferret_ext/frt_store.c +13 -7
  68. data/ext/isomorfeus_ferret_ext/frt_store.h +10 -2
  69. data/ext/isomorfeus_ferret_ext/frt_threading.h +0 -1
  70. data/ext/isomorfeus_ferret_ext/isomorfeus_ferret.c +21 -109
  71. data/ext/isomorfeus_ferret_ext/isomorfeus_ferret.h +2 -32
  72. data/ext/isomorfeus_ferret_ext/lz4.c +2495 -0
  73. data/ext/isomorfeus_ferret_ext/lz4.h +774 -0
  74. data/ext/isomorfeus_ferret_ext/lz4frame.c +1899 -0
  75. data/ext/isomorfeus_ferret_ext/lz4frame.h +623 -0
  76. data/ext/isomorfeus_ferret_ext/lz4hc.c +1615 -0
  77. data/ext/isomorfeus_ferret_ext/lz4hc.h +413 -0
  78. data/ext/isomorfeus_ferret_ext/lz4xxhash.c +1030 -0
  79. data/ext/isomorfeus_ferret_ext/lz4xxhash.h +328 -0
  80. data/ext/isomorfeus_ferret_ext/stem_modules.h +0 -86
  81. data/ext/isomorfeus_ferret_ext/test.c +1 -2
  82. data/ext/isomorfeus_ferret_ext/test_1710.c +11 -12
  83. data/ext/isomorfeus_ferret_ext/test_analysis.c +590 -583
  84. data/ext/isomorfeus_ferret_ext/test_compound_io.c +1 -1
  85. data/ext/isomorfeus_ferret_ext/test_document.c +19 -15
  86. data/ext/isomorfeus_ferret_ext/test_except.c +1 -2
  87. data/ext/isomorfeus_ferret_ext/test_fields.c +59 -60
  88. data/ext/isomorfeus_ferret_ext/test_file_deleter.c +10 -27
  89. data/ext/isomorfeus_ferret_ext/test_filter.c +11 -8
  90. data/ext/isomorfeus_ferret_ext/test_hash.c +2 -2
  91. data/ext/isomorfeus_ferret_ext/test_hashset.c +1 -1
  92. data/ext/isomorfeus_ferret_ext/test_highlighter.c +15 -11
  93. data/ext/isomorfeus_ferret_ext/test_index.c +372 -365
  94. data/ext/isomorfeus_ferret_ext/test_q_const_score.c +5 -3
  95. data/ext/isomorfeus_ferret_ext/test_q_filtered.c +5 -3
  96. data/ext/isomorfeus_ferret_ext/test_q_fuzzy.c +13 -10
  97. data/ext/isomorfeus_ferret_ext/test_q_parser.c +45 -7
  98. data/ext/isomorfeus_ferret_ext/test_q_span.c +15 -12
  99. data/ext/isomorfeus_ferret_ext/test_ram_store.c +3 -3
  100. data/ext/isomorfeus_ferret_ext/test_search.c +60 -62
  101. data/ext/isomorfeus_ferret_ext/test_segments.c +5 -4
  102. data/ext/isomorfeus_ferret_ext/test_sort.c +17 -14
  103. data/ext/isomorfeus_ferret_ext/test_store.c +2 -0
  104. data/ext/isomorfeus_ferret_ext/test_term.c +3 -1
  105. data/ext/isomorfeus_ferret_ext/test_term_vectors.c +9 -10
  106. data/ext/isomorfeus_ferret_ext/test_test.c +1 -2
  107. data/ext/isomorfeus_ferret_ext/test_threading.c +9 -10
  108. data/ext/isomorfeus_ferret_ext/testhelper.c +1 -2
  109. data/lib/isomorfeus/ferret/version.rb +1 -1
  110. metadata +27 -57
  111. data/ext/isomorfeus_ferret_ext/email.rl +0 -21
  112. data/ext/isomorfeus_ferret_ext/frt_scanner.c +0 -900
  113. data/ext/isomorfeus_ferret_ext/frt_scanner.h +0 -28
  114. data/ext/isomorfeus_ferret_ext/frt_scanner_mb.c +0 -6706
  115. data/ext/isomorfeus_ferret_ext/frt_scanner_utf8.c +0 -4420
  116. data/ext/isomorfeus_ferret_ext/scanner.h +0 -28
  117. data/ext/isomorfeus_ferret_ext/scanner.in +0 -43
  118. data/ext/isomorfeus_ferret_ext/scanner.rl +0 -84
  119. data/ext/isomorfeus_ferret_ext/scanner_mb.rl +0 -200
  120. data/ext/isomorfeus_ferret_ext/scanner_utf8.rl +0 -85
  121. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_basque.c +0 -1167
  122. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_basque.h +0 -6
  123. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_catalan.c +0 -1433
  124. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_catalan.h +0 -6
  125. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_danish.c +0 -301
  126. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_danish.h +0 -6
  127. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_dutch.c +0 -590
  128. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_dutch.h +0 -6
  129. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_english.c +0 -1049
  130. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_english.h +0 -6
  131. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_finnish.c +0 -705
  132. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_finnish.h +0 -6
  133. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_french.c +0 -1239
  134. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_french.h +0 -6
  135. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_german.c +0 -477
  136. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_german.h +0 -6
  137. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_hungarian.c +0 -1217
  138. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_hungarian.h +0 -7
  139. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_indonesian.c +0 -394
  140. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_indonesian.h +0 -6
  141. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_irish.c +0 -457
  142. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_irish.h +0 -6
  143. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_italian.c +0 -1009
  144. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_italian.h +0 -6
  145. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_norwegian.c +0 -259
  146. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_norwegian.h +0 -6
  147. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_porter.c +0 -704
  148. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_porter.h +0 -6
  149. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_portuguese.c +0 -948
  150. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_portuguese.h +0 -6
  151. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_spanish.c +0 -1028
  152. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_spanish.h +0 -6
  153. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_swedish.c +0 -275
  154. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_1_swedish.h +0 -6
  155. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_2_hungarian.c +0 -849
  156. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_2_hungarian.h +0 -6
  157. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_2_romanian.c +0 -952
  158. data/ext/isomorfeus_ferret_ext/stem_ISO_8859_2_romanian.h +0 -6
  159. data/ext/isomorfeus_ferret_ext/stem_KOI8_R_russian.c +0 -669
  160. data/ext/isomorfeus_ferret_ext/stem_KOI8_R_russian.h +0 -6
  161. data/ext/isomorfeus_ferret_ext/stem_modules.txt +0 -63
  162. data/ext/isomorfeus_ferret_ext/uchar-ucs4.rl +0 -1854
  163. data/ext/isomorfeus_ferret_ext/uchar-utf8.rl +0 -1999
  164. data/ext/isomorfeus_ferret_ext/url.rl +0 -27
@@ -22,7 +22,6 @@ static VALUE sym_use_typed_range_query;
22
22
  extern VALUE frb_get_analyzer(FrtAnalyzer *a);
23
23
  extern VALUE frb_get_q(FrtQuery *q);
24
24
  extern FrtAnalyzer *frb_get_cwrapped_analyzer(VALUE ranalyzer);
25
- extern FrtQuery *qp_parse(FrtQParser *self, char *qstr);
26
25
 
27
26
  /****************************************************************************
28
27
  *
@@ -30,22 +29,40 @@ extern FrtQuery *qp_parse(FrtQParser *self, char *qstr);
30
29
  *
31
30
  ****************************************************************************/
32
31
 
33
- static void
34
- frb_qp_free(void *p)
35
- {
36
- object_del(p);
32
+ static void frb_qp_free(void *p) {
37
33
  frt_qp_destroy((FrtQParser *)p);
38
34
  }
39
35
 
40
- static void
41
- frb_qp_mark(void *p)
42
- {
43
- frb_gc_mark(((FrtQParser *)p)->analyzer);
36
+ static void frb_qp_mark(void *p) {
37
+ if (((FrtQParser *)p)->analyzer->ranalyzer)
38
+ rb_gc_mark(((FrtQParser *)p)->analyzer->ranalyzer);
44
39
  }
45
40
 
46
- static FrtHashSet *
47
- frb_get_fields(VALUE rfields, FrtHashSet *other_fields)
48
- {
41
+ static size_t frb_qp_size(const void *p) {
42
+ return sizeof(FrtQParser);
43
+ (void)p;
44
+ }
45
+
46
+ const rb_data_type_t frb_qp_t = {
47
+ .wrap_struct_name = "FrbQueryParser",
48
+ .function = {
49
+ .dmark = frb_qp_mark,
50
+ .dfree = frb_qp_free,
51
+ .dsize = frb_qp_size,
52
+ .dcompact = NULL,
53
+ .reserved = {0},
54
+ },
55
+ .parent = NULL,
56
+ .data = NULL,
57
+ .flags = RUBY_TYPED_FREE_IMMEDIATELY
58
+ };
59
+
60
+ static VALUE frb_qp_alloc(VALUE rclass) {
61
+ FrtQParser *qp = frt_qp_alloc();
62
+ return TypedData_Wrap_Struct(rclass, &frb_qp_t, qp);
63
+ }
64
+
65
+ static FrtHashSet *frb_get_fields(VALUE rfields, FrtHashSet *other_fields) {
49
66
  VALUE rval;
50
67
  FrtHashSet *fields;
51
68
  char *s, *p, *str;
@@ -78,9 +95,7 @@ frb_get_fields(VALUE rfields, FrtHashSet *other_fields)
78
95
  return fields;
79
96
  }
80
97
 
81
- static void
82
- hs_safe_merge(FrtHashSet *merger, FrtHashSet *mergee)
83
- {
98
+ static void hs_safe_merge(FrtHashSet *merger, FrtHashSet *mergee) {
84
99
  FrtHashSetEntry *entry = mergee->first;
85
100
  for (; entry != NULL; entry = entry->next) {
86
101
  frt_hs_add_safe(merger, entry->elem);
@@ -148,9 +163,7 @@ hs_safe_merge(FrtHashSet *merger, FrtHashSet *mergee)
148
163
  * Note: the default is set to true in the Index
149
164
  * class.
150
165
  */
151
- static VALUE
152
- frb_qp_init(int argc, VALUE *argv, VALUE self)
153
- {
166
+ static VALUE frb_qp_init(int argc, VALUE *argv, VALUE self) {
154
167
  VALUE roptions = Qnil;
155
168
  VALUE rval;
156
169
  FrtAnalyzer *analyzer = NULL;
@@ -158,7 +171,7 @@ frb_qp_init(int argc, VALUE *argv, VALUE self)
158
171
  FrtHashSet *all_fields = NULL;
159
172
  FrtHashSet *tkz_fields = NULL;
160
173
  FrtQParser *qp;
161
-
174
+ TypedData_Get_Struct(self, FrtQParser, &frb_qp_t, qp);
162
175
  if (rb_scan_args(argc, argv, "01", &roptions) > 0) {
163
176
  if (TYPE(roptions) == T_HASH) {
164
177
  if (Qnil != (rval = rb_hash_aref(roptions, sym_default_field))) {
@@ -185,12 +198,9 @@ frb_qp_init(int argc, VALUE *argv, VALUE self)
185
198
  all_fields = frt_hs_new_ptr(NULL);
186
199
  }
187
200
  if (!analyzer) {
188
- analyzer = frt_mb_standard_analyzer_new(true);
201
+ analyzer = frt_standard_analyzer_new(true);
189
202
  }
190
- qp = frt_qp_new(analyzer);
191
- //frt_hs_destroy(qp->all_fields);
192
- //frt_hs_destroy(qp->def_fields);
193
- //frt_hs_destroy(qp->tokenized_fields);
203
+ qp = frt_qp_init(qp, analyzer);
194
204
  if (def_fields) hs_safe_merge(all_fields, def_fields);
195
205
  if (tkz_fields) hs_safe_merge(all_fields, tkz_fields);
196
206
  qp->all_fields = all_fields;
@@ -231,8 +241,6 @@ frb_qp_init(int argc, VALUE *argv, VALUE self)
231
241
  qp->use_typed_range_query = RTEST(rval);
232
242
  }
233
243
  }
234
- Frt_Wrap_Struct(self, frb_qp_mark, frb_qp_free, qp);
235
- object_add(qp, self);
236
244
  return self;
237
245
  }
238
246
 
@@ -244,19 +252,17 @@ frb_qp_init(int argc, VALUE *argv, VALUE self)
244
252
  * Parse a query string returning a Query object if parsing was successful.
245
253
  * Will raise a QueryParseException if unsuccessful.
246
254
  */
247
- static VALUE
248
- frb_qp_parse(VALUE self, VALUE rstr)
249
- {
255
+ static VALUE frb_qp_parse(VALUE self, VALUE rstr) {
250
256
  const char *volatile msg = NULL;
251
257
  volatile VALUE rq;
252
258
  GET_QP;
253
259
  FrtQuery *q;
254
260
  rstr = rb_obj_as_string(rstr);
255
261
  FRT_TRY
256
- q = qp_parse(qp, rs2s(rstr));
262
+ q = qp_parse(qp, rs2s(rstr), rb_enc_get(rstr));
257
263
  rq = frb_get_q(q);
258
264
  break;
259
- default:
265
+ FRT_XCATCHALL
260
266
  msg = xcontext.msg;
261
267
  FRT_HANDLED();
262
268
  FRT_XENDTRY
@@ -272,9 +278,7 @@ frb_qp_parse(VALUE self, VALUE rstr)
272
278
  *
273
279
  * Returns the list of all fields that the QueryParser knows about.
274
280
  */
275
- static VALUE
276
- frb_qp_get_fields(VALUE self)
277
- {
281
+ static VALUE frb_qp_get_fields(VALUE self) {
278
282
  GET_QP;
279
283
  FrtHashSet *fields = qp->all_fields;
280
284
  FrtHashSetEntry *hse;
@@ -293,9 +297,7 @@ frb_qp_get_fields(VALUE self)
293
297
  *
294
298
  * Set the list of fields. These fields are expanded for searches on "*".
295
299
  */
296
- static VALUE
297
- frb_qp_set_fields(VALUE self, VALUE rfields)
298
- {
300
+ static VALUE frb_qp_set_fields(VALUE self, VALUE rfields) {
299
301
  GET_QP;
300
302
  FrtHashSet *fields = frb_get_fields(rfields, NULL);
301
303
 
@@ -332,9 +334,7 @@ frb_qp_set_fields(VALUE self, VALUE rfields)
332
334
  *
333
335
  * Returns the list of all tokenized_fields that the QueryParser knows about.
334
336
  */
335
- static VALUE
336
- frb_qp_get_tkz_fields(VALUE self)
337
- {
337
+ static VALUE frb_qp_get_tkz_fields(VALUE self) {
338
338
  GET_QP;
339
339
  FrtHashSet *fields = qp->tokenized_fields;
340
340
  if (fields) {
@@ -346,8 +346,7 @@ frb_qp_get_tkz_fields(VALUE self)
346
346
  }
347
347
 
348
348
  return rfields;
349
- }
350
- else {
349
+ } else {
351
350
  return Qnil;
352
351
  }
353
352
  }
@@ -359,9 +358,7 @@ frb_qp_get_tkz_fields(VALUE self)
359
358
  * Set the list of tokenized_fields. These tokenized_fields are tokenized in
360
359
  * the queries. If this is set to Qnil then all fields will be tokenized.
361
360
  */
362
- static VALUE
363
- frb_qp_set_tkz_fields(VALUE self, VALUE rfields)
364
- {
361
+ static VALUE frb_qp_set_tkz_fields(VALUE self, VALUE rfields) {
365
362
  GET_QP;
366
363
  if (qp->tokenized_fields != qp->all_fields) {
367
364
  frt_hs_destroy(qp->tokenized_fields);
@@ -389,12 +386,8 @@ extern VALUE cQueryParser = rb_define_module_under(mFerret, "QueryParser");
389
386
  * Exception raised when there is an error parsing the query string passed to
390
387
  * QueryParser.
391
388
  */
392
- void
393
- Init_QueryParseException(void)
394
- {
395
- cQueryParseException = rb_define_class_under(cQueryParser,
396
- "QueryParseException",
397
- rb_eStandardError);
389
+ void Init_QueryParseException(void) {
390
+ cQueryParseException = rb_define_class_under(cQueryParser, "QueryParseException", rb_eStandardError);
398
391
  }
399
392
 
400
393
  /*
@@ -593,9 +586,7 @@ Init_QueryParseException(void)
593
586
  * will iterate over.
594
587
  *
595
588
  */
596
- void
597
- Init_QueryParser(void)
598
- {
589
+ void Init_QueryParser(void) {
599
590
  /* hash keys */
600
591
  sym_wild_card_downcase = ID2SYM(rb_intern("wild_card_downcase"));
601
592
  sym_fields = ID2SYM(rb_intern("fields"));
@@ -613,17 +604,14 @@ Init_QueryParser(void)
613
604
 
614
605
  /* QueryParser */
615
606
  cQueryParser = rb_define_class_under(mFerret, "QueryParser", rb_cObject);
616
- rb_define_alloc_func(cQueryParser, frb_data_alloc);
607
+ rb_define_alloc_func(cQueryParser, frb_qp_alloc);
617
608
 
618
609
  rb_define_method(cQueryParser, "initialize", frb_qp_init, -1);
619
610
  rb_define_method(cQueryParser, "parse", frb_qp_parse, 1);
620
611
  rb_define_method(cQueryParser, "fields", frb_qp_get_fields, 0);
621
612
  rb_define_method(cQueryParser, "fields=", frb_qp_set_fields, 1);
622
- rb_define_method(cQueryParser, "tokenized_fields",
623
- frb_qp_get_tkz_fields, 0);
624
- rb_define_method(cQueryParser, "tokenized_fields=",
625
- frb_qp_set_tkz_fields, 1);
613
+ rb_define_method(cQueryParser, "tokenized_fields", frb_qp_get_tkz_fields, 0);
614
+ rb_define_method(cQueryParser, "tokenized_fields=", frb_qp_set_tkz_fields, 1);
626
615
 
627
616
  Init_QueryParseException();
628
617
  }
629
-