[honey] Fix bug decoding tail-ngram entries
commit99873ea22f22e8cb99d4f1db2d6591c2f725afa8
authorOlly Betts <olly@survex.com>
Mon, 14 Aug 2023 23:46:19 +0000 (15 11:46 +1200)
committerOlly Betts <olly@survex.com>
Mon, 14 Aug 2023 23:46:19 +0000 (15 11:46 +1200)
tree9bc646f4f3963543223605fff898cd006bcec4ce
parentb0be18aeaa6492ae4f4f33e2627a17bdd86be842
[honey] Fix bug decoding tail-ngram entries

In the unusual case where the prefix to reuse from the key in the
first term overlaps with the known two byte suffix we weren't
correctly decoding the entry (which could have knock-on effects
for decoding subsequent terms with the same two last bytes.

This encoding isn't really sensible as in most cases we can't reuse
anything from the key in the first entry and at most there are two
bytes to reuse, so it'd be more efficient to just not store the
first reuse count byte, but for now just fix the decoding to work
correctly.
xapian-core/backends/honey/honey_spelling.cc
xapian-core/tests/api_spelling.cc