support xapian ngrams

Xapian supports an "ngrams" option to help with languages/scripts
without explicit wordbreaks, such as Chinese / Japanese / Korean.

Add some plumbing for supporting this in mu as well. Experimental for
now.
This commit is contained in:
Dirk-Jan C. Binnema
2023-09-09 11:57:05 +03:00
parent f6122ecc9e
commit 264bb092f0
20 changed files with 207 additions and 81 deletions

View File

@ -149,9 +149,17 @@ gobject_dep = dependency('gobject-2.0', version: '>= 2.60')
gio_dep = dependency('gio-2.0', version: '>= 2.60')
gio_unix_dep = dependency('gio-unix-2.0', version: '>= 2.60')
gmime_dep = dependency('gmime-3.0', version: '>= 3.2')
xapian_dep = dependency('xapian-core', version:'>= 1.4')
thread_dep = dependency('threads')
# we need Xapian 1.4; if we have 1.4.23, we have some newer APIs.
xapian_dep = dependency('xapian-core', version:'>= 1.4.23', required:false)
if xapian_dep.found()
config_h_data.set('HAVE_XAPIAN_FLAG_NGRAMS', 1)
else
xapian_dep = dependency('xapian-core', version:'>= 1.4')
message('Found xapian ' + xapian_dep.version())
endif
# optionally, use Compact Language Detector2 if we can find it.
cld2_dep = meson.get_compiler('cpp').find_library('cld2', required: false)
if cld2_dep.found()