| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | #include <config.h> |
|---|
| 22 | |
|---|
| 23 | #include <xapian/error.h> |
|---|
| 24 | #include <xapian/types.h> |
|---|
| 25 | |
|---|
| 26 | #include "expandweight.h" |
|---|
| 27 | #include "flint_spelling.h" |
|---|
| 28 | #include "flint_utils.h" |
|---|
| 29 | #include "omassert.h" |
|---|
| 30 | #include "ortermlist.h" |
|---|
| 31 | |
|---|
| 32 | #include <algorithm> |
|---|
| 33 | #include <map> |
|---|
| 34 | #include <queue> |
|---|
| 35 | #include <vector> |
|---|
| 36 | #include <set> |
|---|
| 37 | #include <string> |
|---|
| 38 | |
|---|
| 39 | using namespace std; |
|---|
| 40 | |
|---|
| 41 | |
|---|
| 42 | |
|---|
| 43 | |
|---|
| 44 | |
|---|
| 45 | #define MAGIC_XOR_VALUE 96 |
|---|
| 46 | |
|---|
| 47 | class PrefixCompressedStringItor { |
|---|
| 48 | const unsigned char * p; |
|---|
| 49 | size_t left; |
|---|
| 50 | string current; |
|---|
| 51 | |
|---|
| 52 | PrefixCompressedStringItor(const unsigned char * p_, size_t left_, |
|---|
| 53 | const string ¤t_) |
|---|
| 54 | : p(p_), left(left_), current(current_) { } |
|---|
| 55 | |
|---|
| 56 | public: |
|---|
| 57 | PrefixCompressedStringItor(const std::string & s) |
|---|
| 58 | : p(reinterpret_cast<const unsigned char *>(s.data())), |
|---|
| 59 | left(s.size()) { |
|---|
| 60 | if (left) { |
|---|
| 61 | operator++(); |
|---|
| 62 | } else { |
|---|
| 63 | p = NULL; |
|---|
| 64 | } |
|---|
| 65 | } |
|---|
| 66 | |
|---|
| 67 | const string & operator*() const { |
|---|
| 68 | return current; |
|---|
| 69 | } |
|---|
| 70 | |
|---|
| 71 | PrefixCompressedStringItor operator++(int) { |
|---|
| 72 | const unsigned char * old_p = p; |
|---|
| 73 | size_t old_left = left; |
|---|
| 74 | string old_current = current; |
|---|
| 75 | operator++(); |
|---|
| 76 | return PrefixCompressedStringItor(old_p, old_left, old_current); |
|---|
| 77 | } |
|---|
| 78 | |
|---|
| 79 | PrefixCompressedStringItor & operator++() { |
|---|
| 80 | if (left == 0) { |
|---|
| 81 | p = NULL; |
|---|
| 82 | } else { |
|---|
| 83 | if (!current.empty()) { |
|---|
| 84 | current.resize(*p++ ^ MAGIC_XOR_VALUE); |
|---|
| 85 | --left; |
|---|
| 86 | } |
|---|
| 87 | size_t add; |
|---|
| 88 | if (left == 0 || (add = *p ^ MAGIC_XOR_VALUE) >= left) |
|---|
| 89 | throw Xapian::DatabaseCorruptError("Bad spelling data (too little left)"); |
|---|
| 90 | current.append(reinterpret_cast<const char *>(p + 1), add); |
|---|
| 91 | p += add + 1; |
|---|
| 92 | left -= add + 1; |
|---|
| 93 | } |
|---|
| 94 | return *this; |
|---|
| 95 | } |
|---|
| 96 | |
|---|
| 97 | bool at_end() const { |
|---|
| 98 | return p == NULL; |
|---|
| 99 | } |
|---|
| 100 | }; |
|---|
| 101 | |
|---|
| 102 | class PrefixCompressedStringWriter { |
|---|
| 103 | string current; |
|---|
| 104 | string & out; |
|---|
| 105 | |
|---|
| 106 | public: |
|---|
| 107 | PrefixCompressedStringWriter(string & out_) : out(out_) { } |
|---|
| 108 | |
|---|
| 109 | void append(const string & word) { |
|---|
| 110 | |
|---|
| 111 | |
|---|
| 112 | if (!current.empty()) { |
|---|
| 113 | size_t len = min(current.size(), word.size()); |
|---|
| 114 | size_t i; |
|---|
| 115 | for (i = 0; i < len; ++i) { |
|---|
| 116 | if (current[i] != word[i]) break; |
|---|
| 117 | } |
|---|
| 118 | out += char(i ^ MAGIC_XOR_VALUE); |
|---|
| 119 | out += char((word.size() - i) ^ MAGIC_XOR_VALUE); |
|---|
| 120 | out.append(word.data() + i, word.size() - i); |
|---|
| 121 | } else { |
|---|
| 122 | out += char(word.size() ^ MAGIC_XOR_VALUE); |
|---|
| 123 | out += word; |
|---|
| 124 | } |
|---|
| 125 | current = word; |
|---|
| 126 | } |
|---|
| 127 | }; |
|---|
| 128 | |
|---|
| 129 | void |
|---|
| 130 | FlintSpellingTable::merge_changes() |
|---|
| 131 | { |
|---|
| 132 | map<fragment, set<string> >::const_iterator i; |
|---|
| 133 | for (i = termlist_deltas.begin(); i != termlist_deltas.end(); ++i) { |
|---|
| 134 | string key = i->first; |
|---|
| 135 | const set<string> & changes = i->second; |
|---|
| 136 | |
|---|
| 137 | set<string>::const_iterator d = changes.begin(); |
|---|
| 138 | Assert(d != changes.end()); |
|---|
| 139 | |
|---|
| 140 | string updated; |
|---|
| 141 | string current; |
|---|
| 142 | PrefixCompressedStringWriter out(updated); |
|---|
| 143 | if (get_exact_entry(key, current)) { |
|---|
| 144 | PrefixCompressedStringItor in(current); |
|---|
| 145 | updated.reserve(current.size()); |
|---|
| 146 | while (!in.at_end()) { |
|---|
| 147 | const string & word = *in; |
|---|
| 148 | if (word < *d) { |
|---|
| 149 | out.append(word); |
|---|
| 150 | ++in; |
|---|
| 151 | } else if (word > *d) { |
|---|
| 152 | out.append(*d++); |
|---|
| 153 | if (d == changes.end()) break; |
|---|
| 154 | continue; |
|---|
| 155 | } else { |
|---|
| 156 | |
|---|
| 157 | |
|---|
| 158 | ++in; |
|---|
| 159 | ++d; |
|---|
| 160 | } |
|---|
| 161 | } |
|---|
| 162 | if (!in.at_end()) { |
|---|
| 163 | |
|---|
| 164 | while (!in.at_end()) { |
|---|
| 165 | out.append(*in++); |
|---|
| 166 | } |
|---|
| 167 | } |
|---|
| 168 | } |
|---|
| 169 | while (d != changes.end()) { |
|---|
| 170 | out.append(*d++); |
|---|
| 171 | } |
|---|
| 172 | if (!updated.empty()) { |
|---|
| 173 | add(key, updated); |
|---|
| 174 | } else { |
|---|
| 175 | del(key); |
|---|
| 176 | } |
|---|
| 177 | } |
|---|
| 178 | termlist_deltas.clear(); |
|---|
| 179 | |
|---|
| 180 | map<string, Xapian::termcount>::const_iterator j; |
|---|
| 181 | for (j = wordfreq_changes.begin(); j != wordfreq_changes.end(); ++j) { |
|---|
| 182 | string key = "W" + j->first; |
|---|
| 183 | if (j->second) { |
|---|
| 184 | add(key, pack_uint_last(j->second)); |
|---|
| 185 | } else { |
|---|
| 186 | del(key); |
|---|
| 187 | } |
|---|
| 188 | } |
|---|
| 189 | wordfreq_changes.clear(); |
|---|
| 190 | } |
|---|
| 191 | |
|---|
| 192 | void |
|---|
| 193 | FlintSpellingTable::add_fragment(fragment frag, const string & word) |
|---|
| 194 | { |
|---|
| 195 | map<fragment, set<string> >::iterator i = termlist_deltas.find(frag); |
|---|
| 196 | if (i == termlist_deltas.end()) { |
|---|
| 197 | i = termlist_deltas.insert(make_pair(frag, set<string>())).first; |
|---|
| 198 | } |
|---|
| 199 | i->second.insert(word); |
|---|
| 200 | } |
|---|
| 201 | |
|---|
| 202 | void |
|---|
| 203 | FlintSpellingTable::add_word(const string & word, Xapian::termcount freqinc) |
|---|
| 204 | { |
|---|
| 205 | if (word.size() <= 1) return; |
|---|
| 206 | |
|---|
| 207 | map<string, Xapian::termcount>::iterator i = wordfreq_changes.find(word); |
|---|
| 208 | if (i != wordfreq_changes.end()) { |
|---|
| 209 | |
|---|
| 210 | if (i->second) { |
|---|
| 211 | i->second += freqinc; |
|---|
| 212 | return; |
|---|
| 213 | } |
|---|
| 214 | } else { |
|---|
| 215 | string key = "W" + word; |
|---|
| 216 | string data; |
|---|
| 217 | if (get_exact_entry(key, data)) { |
|---|
| 218 | |
|---|
| 219 | Xapian::termcount freq; |
|---|
| 220 | const char * p = data.data(); |
|---|
| 221 | if (!unpack_uint_last(&p, p + data.size(), &freq) || freq == 0) { |
|---|
| 222 | throw Xapian::DatabaseCorruptError("Bad spelling word freq"); |
|---|
| 223 | } |
|---|
| 224 | wordfreq_changes[word] = freq + freqinc; |
|---|
| 225 | return; |
|---|
| 226 | } |
|---|
| 227 | } |
|---|
| 228 | |
|---|
| 229 | |
|---|
| 230 | if (i != wordfreq_changes.end()) { |
|---|
| 231 | i->second = freqinc; |
|---|
| 232 | } else { |
|---|
| 233 | wordfreq_changes[word] = freqinc; |
|---|
| 234 | } |
|---|
| 235 | |
|---|
| 236 | fragment buf; |
|---|
| 237 | |
|---|
| 238 | buf[0] = 'H'; |
|---|
| 239 | buf[1] = word[0]; |
|---|
| 240 | buf[2] = word[1]; |
|---|
| 241 | buf[3] = '\0'; |
|---|
| 242 | add_fragment(buf, word); |
|---|
| 243 | |
|---|
| 244 | |
|---|
| 245 | buf[0] = 'T'; |
|---|
| 246 | buf[1] = word[word.size() - 2]; |
|---|
| 247 | buf[2] = word[word.size() - 1]; |
|---|
| 248 | buf[3] = '\0'; |
|---|
| 249 | add_fragment(buf, word); |
|---|
| 250 | |
|---|
| 251 | if (word.size() <= 4) { |
|---|
| 252 | |
|---|
| 253 | |
|---|
| 254 | |
|---|
| 255 | |
|---|
| 256 | |
|---|
| 257 | |
|---|
| 258 | buf[0] = 'B'; |
|---|
| 259 | buf[1] = word[0]; |
|---|
| 260 | buf[3] = '\0'; |
|---|
| 261 | add_fragment(buf, word); |
|---|
| 262 | } |
|---|
| 263 | if (word.size() > 2) { |
|---|
| 264 | |
|---|
| 265 | buf[0] = 'M'; |
|---|
| 266 | for (size_t start = 0; start <= word.size() - 3; ++start) { |
|---|
| 267 | memcpy(buf.data + 1, word.data() + start, 3); |
|---|
| 268 | add_fragment(buf, word); |
|---|
| 269 | } |
|---|
| 270 | } |
|---|
| 271 | } |
|---|
| 272 | |
|---|
| 273 | void |
|---|
| 274 | FlintSpellingTable::remove_fragment(fragment frag, const string & word) |
|---|
| 275 | { |
|---|
| 276 | map<fragment, set<string> >::iterator i = termlist_deltas.find(frag); |
|---|
| 277 | if (i != termlist_deltas.end()) { |
|---|
| 278 | i->second.erase(word); |
|---|
| 279 | } |
|---|
| 280 | } |
|---|
| 281 | |
|---|
| 282 | void |
|---|
| 283 | FlintSpellingTable::remove_word(const string & word, Xapian::termcount freqdec) |
|---|
| 284 | { |
|---|
| 285 | map<string, Xapian::termcount>::iterator i = wordfreq_changes.find(word); |
|---|
| 286 | if (i != wordfreq_changes.end()) { |
|---|
| 287 | if (i->second == 0) { |
|---|
| 288 | |
|---|
| 289 | return; |
|---|
| 290 | } |
|---|
| 291 | |
|---|
| 292 | if (freqdec < i->second) { |
|---|
| 293 | i->second -= freqdec; |
|---|
| 294 | return; |
|---|
| 295 | } |
|---|
| 296 | } |
|---|
| 297 | |
|---|
| 298 | { |
|---|
| 299 | string key = "W" + word; |
|---|
| 300 | string data; |
|---|
| 301 | if (!get_exact_entry(key, data)) { |
|---|
| 302 | |
|---|
| 303 | return; |
|---|
| 304 | } |
|---|
| 305 | |
|---|
| 306 | Xapian::termcount freq; |
|---|
| 307 | const char *p = data.data(); |
|---|
| 308 | if (!unpack_uint_last(&p, p + data.size(), &freq)) { |
|---|
| 309 | throw Xapian::DatabaseCorruptError("Bad spelling word freq"); |
|---|
| 310 | } |
|---|
| 311 | if (freqdec < freq) { |
|---|
| 312 | wordfreq_changes[word] = freq - freqdec; |
|---|
| 313 | return; |
|---|
| 314 | } |
|---|
| 315 | } |
|---|
| 316 | |
|---|
| 317 | |
|---|
| 318 | wordfreq_changes[word] = 0; |
|---|
| 319 | |
|---|
| 320 | fragment buf; |
|---|
| 321 | |
|---|
| 322 | buf[0] = 'H'; |
|---|
| 323 | buf[1] = word[0]; |
|---|
| 324 | buf[2] = word[1]; |
|---|
| 325 | buf[3] = '\0'; |
|---|
| 326 | remove_fragment(buf, word); |
|---|
| 327 | |
|---|
| 328 | |
|---|
| 329 | buf[0] = 'T'; |
|---|
| 330 | buf[1] = word[word.size() - 2]; |
|---|
| 331 | buf[2] = word[word.size() - 1]; |
|---|
| 332 | buf[3] = '\0'; |
|---|
| 333 | remove_fragment(buf, word); |
|---|
| 334 | |
|---|
| 335 | if (word.size() <= 4) { |
|---|
| 336 | |
|---|
| 337 | buf[0] = 'B'; |
|---|
| 338 | buf[1] = word[0]; |
|---|
| 339 | buf[3] = '\0'; |
|---|
| 340 | remove_fragment(buf, word); |
|---|
| 341 | } |
|---|
| 342 | if (word.size() > 2) { |
|---|
| 343 | |
|---|
| 344 | buf[0] = 'M'; |
|---|
| 345 | for (size_t start = 0; start <= word.size() - 3; ++start) { |
|---|
| 346 | memcpy(buf.data + 1, word.data() + start, 3); |
|---|
| 347 | remove_fragment(buf, word); |
|---|
| 348 | } |
|---|
| 349 | } |
|---|
| 350 | } |
|---|
| 351 | |
|---|
| 352 | struct TermListGreaterApproxSize { |
|---|
| 353 | bool operator()(const TermList *a, const TermList *b) { |
|---|
| 354 | return a->get_approx_size() > b->get_approx_size(); |
|---|
| 355 | } |
|---|
| 356 | }; |
|---|
| 357 | |
|---|
| 358 | TermList * |
|---|
| 359 | FlintSpellingTable::open_termlist(const string & word) |
|---|
| 360 | { |
|---|
| 361 | if (word.size() <= 1) return NULL; |
|---|
| 362 | |
|---|
| 363 | |
|---|
| 364 | |
|---|
| 365 | if (!wordfreq_changes.empty()) merge_changes(); |
|---|
| 366 | |
|---|
| 367 | |
|---|
| 368 | |
|---|
| 369 | priority_queue<TermList*, vector<TermList*>, TermListGreaterApproxSize> pq; |
|---|
| 370 | try { |
|---|
| 371 | string data; |
|---|
| 372 | fragment buf; |
|---|
| 373 | |
|---|
| 374 | |
|---|
| 375 | buf[0] = 'H'; |
|---|
| 376 | buf[1] = word[0]; |
|---|
| 377 | buf[2] = word[1]; |
|---|
| 378 | if (get_exact_entry(string(buf), data)) |
|---|
| 379 | pq.push(new FlintSpellingTermList(data)); |
|---|
| 380 | |
|---|
| 381 | |
|---|
| 382 | buf[0] = 'T'; |
|---|
| 383 | buf[1] = word[word.size() - 2]; |
|---|
| 384 | buf[2] = word[word.size() - 1]; |
|---|
| 385 | if (get_exact_entry(string(buf), data)) |
|---|
| 386 | pq.push(new FlintSpellingTermList(data)); |
|---|
| 387 | |
|---|
| 388 | if (word.size() <= 4) { |
|---|
| 389 | |
|---|
| 390 | |
|---|
| 391 | |
|---|
| 392 | |
|---|
| 393 | |
|---|
| 394 | buf[0] = 'B'; |
|---|
| 395 | buf[1] = word[0]; |
|---|
| 396 | buf[3] = '\0'; |
|---|
| 397 | if (get_exact_entry(string(buf), data)) |
|---|
| 398 | pq.push(new FlintSpellingTermList(data)); |
|---|
| 399 | } |
|---|
| 400 | if (word.size() > 2) { |
|---|
| 401 | |
|---|
| 402 | buf[0] = 'M'; |
|---|
| 403 | for (size_t start = 0; start <= word.size() - 3; ++start) { |
|---|
| 404 | memcpy(buf.data + 1, word.data() + start, 3); |
|---|
| 405 | if (get_exact_entry(string(buf), data)) |
|---|
| 406 | pq.push(new FlintSpellingTermList(data)); |
|---|
| 407 | } |
|---|
| 408 | |
|---|
| 409 | if (word.size() == 3) { |
|---|
| 410 | |
|---|
| 411 | |
|---|
| 412 | |
|---|
| 413 | |
|---|
| 414 | buf[1] = word[1]; |
|---|
| 415 | buf[2] = word[0]; |
|---|
| 416 | if (get_exact_entry(string(buf), data)) |
|---|
| 417 | pq.push(new FlintSpellingTermList(data)); |
|---|
| 418 | |
|---|
| 419 | buf[1] = word[0]; |
|---|
| 420 | buf[2] = word[2]; |
|---|
| 421 | buf[3] = word[1]; |
|---|
| 422 | if (get_exact_entry(string(buf), data)) |
|---|
| 423 | pq.push(new FlintSpellingTermList(data)); |
|---|
| 424 | } |
|---|
| 425 | } else { |
|---|
| 426 | Assert(word.size() == 2); |
|---|
| 427 | |
|---|
| 428 | |
|---|
| 429 | |
|---|
| 430 | |
|---|
| 431 | buf[0] = 'H'; |
|---|
| 432 | buf[1] = word[1]; |
|---|
| 433 | buf[2] = word[0]; |
|---|
| 434 | if (get_exact_entry(string(buf), data)) |
|---|
| 435 | pq.push(new FlintSpellingTermList(data)); |
|---|
| 436 | buf[0] = 'T'; |
|---|
| 437 | if (get_exact_entry(string(buf), data)) |
|---|
| 438 | pq.push(new FlintSpellingTermList(data)); |
|---|
| 439 | } |
|---|
| 440 | |
|---|
| 441 | if (pq.empty()) return NULL; |
|---|
| 442 | |
|---|
| 443 | |
|---|
| 444 | |
|---|
| 445 | |
|---|
| 446 | |
|---|
| 447 | |
|---|
| 448 | |
|---|
| 449 | |
|---|
| 450 | while (pq.size() > 1) { |
|---|
| 451 | |
|---|
| 452 | |
|---|
| 453 | TermList * termlist = pq.top(); |
|---|
| 454 | pq.pop(); |
|---|
| 455 | |
|---|
| 456 | termlist = new OrTermList(pq.top(), termlist); |
|---|
| 457 | pq.pop(); |
|---|
| 458 | pq.push(termlist); |
|---|
| 459 | } |
|---|
| 460 | |
|---|
| 461 | return pq.top(); |
|---|
| 462 | } catch (...) { |
|---|
| 463 | |
|---|
| 464 | |
|---|
| 465 | while (!pq.empty()) { |
|---|
| 466 | delete pq.top(); |
|---|
| 467 | pq.pop(); |
|---|
| 468 | } |
|---|
| 469 | throw; |
|---|
| 470 | } |
|---|
| 471 | } |
|---|
| 472 | |
|---|
| 473 | Xapian::doccount |
|---|
| 474 | FlintSpellingTable::get_word_frequency(const string & word) const |
|---|
| 475 | { |
|---|
| 476 | map<string, Xapian::termcount>::const_iterator i; |
|---|
| 477 | i = wordfreq_changes.find(word); |
|---|
| 478 | if (i != wordfreq_changes.end()) { |
|---|
| 479 | |
|---|
| 480 | return i->second; |
|---|
| 481 | } |
|---|
| 482 | |
|---|
| 483 | string key = "W" + word; |
|---|
| 484 | string data; |
|---|
| 485 | if (get_exact_entry(key, data)) { |
|---|
| 486 | |
|---|
| 487 | Xapian::termcount freq; |
|---|
| 488 | const char *p = data.data(); |
|---|
| 489 | if (!unpack_uint_last(&p, p + data.size(), &freq)) { |
|---|
| 490 | throw Xapian::DatabaseCorruptError("Bad spelling word freq"); |
|---|
| 491 | } |
|---|
| 492 | return freq; |
|---|
| 493 | } |
|---|
| 494 | |
|---|
| 495 | return 0; |
|---|
| 496 | } |
|---|
| 497 | |
|---|
| 498 | |
|---|
| 499 | |
|---|
| 500 | FlintSpellingTermList::~FlintSpellingTermList() { } |
|---|
| 501 | |
|---|
| 502 | Xapian::termcount |
|---|
| 503 | FlintSpellingTermList::get_approx_size() const |
|---|
| 504 | { |
|---|
| 505 | |
|---|
| 506 | |
|---|
| 507 | return data.size(); |
|---|
| 508 | } |
|---|
| 509 | |
|---|
| 510 | std::string |
|---|
| 511 | FlintSpellingTermList::get_termname() const |
|---|
| 512 | { |
|---|
| 513 | return current_term; |
|---|
| 514 | } |
|---|
| 515 | |
|---|
| 516 | Xapian::termcount |
|---|
| 517 | FlintSpellingTermList::get_wdf() const |
|---|
| 518 | { |
|---|
| 519 | return 1; |
|---|
| 520 | } |
|---|
| 521 | |
|---|
| 522 | Xapian::doccount |
|---|
| 523 | FlintSpellingTermList::get_termfreq() const |
|---|
| 524 | { |
|---|
| 525 | return 1; |
|---|
| 526 | } |
|---|
| 527 | |
|---|
| 528 | Xapian::termcount |
|---|
| 529 | FlintSpellingTermList::get_collection_freq() const |
|---|
| 530 | { |
|---|
| 531 | return 1; |
|---|
| 532 | } |
|---|
| 533 | |
|---|
| 534 | TermList * |
|---|
| 535 | FlintSpellingTermList::next() |
|---|
| 536 | { |
|---|
| 537 | if (p == data.size()) { |
|---|
| 538 | p = 0; |
|---|
| 539 | data.resize(0); |
|---|
| 540 | return NULL; |
|---|
| 541 | } |
|---|
| 542 | if (!current_term.empty()) { |
|---|
| 543 | if (p == data.size()) |
|---|
| 544 | throw Xapian::DatabaseCorruptError("Bad spelling termlist"); |
|---|
| 545 | current_term.resize(byte(data[p++]) ^ MAGIC_XOR_VALUE); |
|---|
| 546 | } |
|---|
| 547 | size_t add; |
|---|
| 548 | if (p == data.size() || |
|---|
| 549 | (add = byte(data[p]) ^ MAGIC_XOR_VALUE) >= data.size() - p) |
|---|
| 550 | throw Xapian::DatabaseCorruptError("Bad spelling termlist"); |
|---|
| 551 | current_term.append(data.data() + p + 1, add); |
|---|
| 552 | p += add + 1; |
|---|
| 553 | return NULL; |
|---|
| 554 | } |
|---|
| 555 | |
|---|
| 556 | bool |
|---|
| 557 | FlintSpellingTermList::at_end() const |
|---|
| 558 | { |
|---|
| 559 | return data.empty(); |
|---|
| 560 | } |
|---|
| 561 | |
|---|
| 562 | Xapian::termcount |
|---|
| 563 | FlintSpellingTermList::positionlist_count() const |
|---|
| 564 | { |
|---|
| 565 | throw Xapian::UnimplementedError("FlintSpellingTermList::positionlist_count() not implemented"); |
|---|
| 566 | } |
|---|
| 567 | |
|---|
| 568 | Xapian::PositionIterator |
|---|
| 569 | FlintSpellingTermList::positionlist_begin() const |
|---|
| 570 | { |
|---|
| 571 | throw Xapian::UnimplementedError("FlintSpellingTermList::positionlist_begin() not implemented"); |
|---|
| 572 | } |
|---|