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
@@ -0,0 +1,282 @@
1
+
2
+ /*-------------------------------------------------------------*/
3
+ /*--- Public header file for the library. ---*/
4
+ /*--- bzlib.h ---*/
5
+ /*-------------------------------------------------------------*/
6
+
7
+ /* ------------------------------------------------------------------
8
+ This file is part of bzip2/libbzip2, a program and library for
9
+ lossless, block-sorting data compression.
10
+
11
+ bzip2/libbzip2 version 1.0.8 of 13 July 2019
12
+ Copyright (C) 1996-2019 Julian Seward <jseward@acm.org>
13
+
14
+ Please read the WARNING, DISCLAIMER and PATENTS sections in the
15
+ README file.
16
+
17
+ This program is released under the terms of the license contained
18
+ in the file LICENSE.
19
+ ------------------------------------------------------------------ */
20
+
21
+
22
+ #ifndef _BZLIB_H
23
+ #define _BZLIB_H
24
+
25
+ #ifdef __cplusplus
26
+ extern "C" {
27
+ #endif
28
+
29
+ #define BZ_RUN 0
30
+ #define BZ_FLUSH 1
31
+ #define BZ_FINISH 2
32
+
33
+ #define BZ_OK 0
34
+ #define BZ_RUN_OK 1
35
+ #define BZ_FLUSH_OK 2
36
+ #define BZ_FINISH_OK 3
37
+ #define BZ_STREAM_END 4
38
+ #define BZ_SEQUENCE_ERROR (-1)
39
+ #define BZ_PARAM_ERROR (-2)
40
+ #define BZ_MEM_ERROR (-3)
41
+ #define BZ_DATA_ERROR (-4)
42
+ #define BZ_DATA_ERROR_MAGIC (-5)
43
+ #define BZ_IO_ERROR (-6)
44
+ #define BZ_UNEXPECTED_EOF (-7)
45
+ #define BZ_OUTBUFF_FULL (-8)
46
+ #define BZ_CONFIG_ERROR (-9)
47
+
48
+ typedef
49
+ struct {
50
+ char *next_in;
51
+ unsigned int avail_in;
52
+ unsigned int total_in_lo32;
53
+ unsigned int total_in_hi32;
54
+
55
+ char *next_out;
56
+ unsigned int avail_out;
57
+ unsigned int total_out_lo32;
58
+ unsigned int total_out_hi32;
59
+
60
+ void *state;
61
+
62
+ void *(*bzalloc)(void *,int,int);
63
+ void (*bzfree)(void *,void *);
64
+ void *opaque;
65
+ }
66
+ bz_stream;
67
+
68
+
69
+ #ifndef BZ_IMPORT
70
+ #define BZ_EXPORT
71
+ #endif
72
+
73
+ #ifndef BZ_NO_STDIO
74
+ /* Need a definitition for FILE */
75
+ #include <stdio.h>
76
+ #endif
77
+
78
+ #ifdef _WIN32
79
+ # include <windows.h>
80
+ # ifdef small
81
+ /* windows.h define small to char */
82
+ # undef small
83
+ # endif
84
+ # ifdef BZ_EXPORT
85
+ # define BZ_API(func) WINAPI func
86
+ # define BZ_EXTERN extern
87
+ # else
88
+ /* import windows dll dynamically */
89
+ # define BZ_API(func) (WINAPI * func)
90
+ # define BZ_EXTERN
91
+ # endif
92
+ #else
93
+ # define BZ_API(func) func
94
+ # define BZ_EXTERN extern
95
+ #endif
96
+
97
+
98
+ /*-- Core (low-level) library functions --*/
99
+
100
+ BZ_EXTERN int BZ_API(BZ2_bzCompressInit) (
101
+ bz_stream* strm,
102
+ int blockSize100k,
103
+ int verbosity,
104
+ int workFactor
105
+ );
106
+
107
+ BZ_EXTERN int BZ_API(BZ2_bzCompress) (
108
+ bz_stream* strm,
109
+ int action
110
+ );
111
+
112
+ BZ_EXTERN int BZ_API(BZ2_bzCompressEnd) (
113
+ bz_stream* strm
114
+ );
115
+
116
+ BZ_EXTERN int BZ_API(BZ2_bzDecompressInit) (
117
+ bz_stream *strm,
118
+ int verbosity,
119
+ int small
120
+ );
121
+
122
+ BZ_EXTERN int BZ_API(BZ2_bzDecompress) (
123
+ bz_stream* strm
124
+ );
125
+
126
+ BZ_EXTERN int BZ_API(BZ2_bzDecompressEnd) (
127
+ bz_stream *strm
128
+ );
129
+
130
+
131
+
132
+ /*-- High(er) level library functions --*/
133
+
134
+ #ifndef BZ_NO_STDIO
135
+ #define BZ_MAX_UNUSED 5000
136
+
137
+ typedef void BZFILE;
138
+
139
+ BZ_EXTERN BZFILE* BZ_API(BZ2_bzReadOpen) (
140
+ int* bzerror,
141
+ FILE* f,
142
+ int verbosity,
143
+ int small,
144
+ void* unused,
145
+ int nUnused
146
+ );
147
+
148
+ BZ_EXTERN void BZ_API(BZ2_bzReadClose) (
149
+ int* bzerror,
150
+ BZFILE* b
151
+ );
152
+
153
+ BZ_EXTERN void BZ_API(BZ2_bzReadGetUnused) (
154
+ int* bzerror,
155
+ BZFILE* b,
156
+ void** unused,
157
+ int* nUnused
158
+ );
159
+
160
+ BZ_EXTERN int BZ_API(BZ2_bzRead) (
161
+ int* bzerror,
162
+ BZFILE* b,
163
+ void* buf,
164
+ int len
165
+ );
166
+
167
+ BZ_EXTERN BZFILE* BZ_API(BZ2_bzWriteOpen) (
168
+ int* bzerror,
169
+ FILE* f,
170
+ int blockSize100k,
171
+ int verbosity,
172
+ int workFactor
173
+ );
174
+
175
+ BZ_EXTERN void BZ_API(BZ2_bzWrite) (
176
+ int* bzerror,
177
+ BZFILE* b,
178
+ void* buf,
179
+ int len
180
+ );
181
+
182
+ BZ_EXTERN void BZ_API(BZ2_bzWriteClose) (
183
+ int* bzerror,
184
+ BZFILE* b,
185
+ int abandon,
186
+ unsigned int* nbytes_in,
187
+ unsigned int* nbytes_out
188
+ );
189
+
190
+ BZ_EXTERN void BZ_API(BZ2_bzWriteClose64) (
191
+ int* bzerror,
192
+ BZFILE* b,
193
+ int abandon,
194
+ unsigned int* nbytes_in_lo32,
195
+ unsigned int* nbytes_in_hi32,
196
+ unsigned int* nbytes_out_lo32,
197
+ unsigned int* nbytes_out_hi32
198
+ );
199
+ #endif
200
+
201
+
202
+ /*-- Utility functions --*/
203
+
204
+ BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffCompress) (
205
+ char* dest,
206
+ unsigned int* destLen,
207
+ char* source,
208
+ unsigned int sourceLen,
209
+ int blockSize100k,
210
+ int verbosity,
211
+ int workFactor
212
+ );
213
+
214
+ BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffDecompress) (
215
+ char* dest,
216
+ unsigned int* destLen,
217
+ char* source,
218
+ unsigned int sourceLen,
219
+ int small,
220
+ int verbosity
221
+ );
222
+
223
+
224
+ /*--
225
+ Code contributed by Yoshioka Tsuneo (tsuneo@rr.iij4u.or.jp)
226
+ to support better zlib compatibility.
227
+ This code is not _officially_ part of libbzip2 (yet);
228
+ I haven't tested it, documented it, or considered the
229
+ threading-safeness of it.
230
+ If this code breaks, please contact both Yoshioka and me.
231
+ --*/
232
+
233
+ BZ_EXTERN const char * BZ_API(BZ2_bzlibVersion) (
234
+ void
235
+ );
236
+
237
+ #ifndef BZ_NO_STDIO
238
+ BZ_EXTERN BZFILE * BZ_API(BZ2_bzopen) (
239
+ const char *path,
240
+ const char *mode
241
+ );
242
+
243
+ BZ_EXTERN BZFILE * BZ_API(BZ2_bzdopen) (
244
+ int fd,
245
+ const char *mode
246
+ );
247
+
248
+ BZ_EXTERN int BZ_API(BZ2_bzread) (
249
+ BZFILE* b,
250
+ void* buf,
251
+ int len
252
+ );
253
+
254
+ BZ_EXTERN int BZ_API(BZ2_bzwrite) (
255
+ BZFILE* b,
256
+ void* buf,
257
+ int len
258
+ );
259
+
260
+ BZ_EXTERN int BZ_API(BZ2_bzflush) (
261
+ BZFILE* b
262
+ );
263
+
264
+ BZ_EXTERN void BZ_API(BZ2_bzclose) (
265
+ BZFILE* b
266
+ );
267
+
268
+ BZ_EXTERN const char * BZ_API(BZ2_bzerror) (
269
+ BZFILE *b,
270
+ int *errnum
271
+ );
272
+ #endif
273
+
274
+ #ifdef __cplusplus
275
+ }
276
+ #endif
277
+
278
+ #endif
279
+
280
+ /*-------------------------------------------------------------*/
281
+ /*--- end bzlib.h ---*/
282
+ /*-------------------------------------------------------------*/