simple

package
v0.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Vendored: simple FTS5 tokenizer + cppjieba

Statically compiled into MemSpace (cgo) so Chinese full-text search needs no loadable extension and no system libraries.

Component Source Version License
simple (SQLite FTS5 tokenizer, jieba_query, simple_highlight) https://github.com/wangfenjin/simple 45db071 (2026-05-17) MIT (dual MIT/GPL-3.0, MIT chosen), LICENSE-simple
cppjieba + limonp (header-only) https://github.com/yanyiwu/cppjieba 194c144 (the commit simple pins) MIT, LICENSE-cppjieba
jieba dictionaries (data/*.utf8.gz) cppjieba dict/ same MIT
pinyin table (data/pinyin.txt.gz) simple contrib/pinyin.txt same MIT
include/sqlite3-binding.h, include/sqlite3ext.h mattn/go-sqlite3 v1.14.52 public domain

Local changes:

  • include/cmrc/cmrc.hpp replaces CMakeRC; memspace_glue.cc supplies the embedded pinyin bytes and the jieba dictionary directory from Go.
  • data/user.dict.utf8 is MemSpace's technical-term dictionary (not upstream).
  • include/limonp/StringUtil.hpp: the trim helpers use lambdas instead of std::ptr_fun / std::bind2nd, which C++17 removed (libc++ on macOS rejects them).

Upstream source files are otherwise unmodified. When updating, keep the SQLite headers in sync with the mattn/go-sqlite3 version in go.mod.

Documentation

Overview

Package simple statically links the simple FTS5 tokenizer (with cppjieba) into SQLite as provided by mattn/go-sqlite3.

Index-side tokenization is per character (plus pinyin), so any Chinese substring is findable; jieba_query() segments queries into words, so matches are word-precise when the dictionary knows the word and fall back to character sequences when it does not.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Available

func Available() bool

Available reports whether this build includes the tokenizer.

func Init

func Init(cacheDir string) error

Init registers the tokenizer for every SQLite connection opened afterwards and points jieba at its dictionaries, extracted under cacheDir. It must run before the first connection is opened; later calls are no-ops.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL