[BREAKGLASS] A FTS5 extension for signal_tokenizer.
Go to file
Fedor Indutny a2a00359b1
Some checks failed
CI / build (push) Has been cancelled
CI / fmt (push) Has been cancelled
deps: move to criterion 0.5
2024-08-26 12:03:39 -04:00
.github/workflows initial 2023-02-10 11:41:26 -08:00
benches initial 2023-02-10 11:41:26 -08:00
src fix: ignore strings with invalid UTF-8 contents 2023-02-10 11:41:33 -08:00
.gitignore initial 2023-02-10 11:41:26 -08:00
Cargo.lock deps: move to criterion 0.5 2024-08-26 12:03:39 -04:00
Cargo.toml deps: move to criterion 0.5 2024-08-26 12:03:39 -04:00
cbindgen.toml initial 2023-02-10 11:41:26 -08:00
LICENSE initial 2023-02-10 11:41:26 -08:00
README.md initial 2023-02-10 11:41:26 -08:00

Overview

Signal-FTS5-Extension is a C ABI library which exposes a FTS5 tokenizer function named signal_tokenizer that:

  • Segments UTF-8 strings into words according to Unicode standard
  • Normalizes and removes diacritics from words
  • Converts words to lower case

When used as a custom FTS5 tokenizer this enables application to support CJK symbols in full-text search.

Extension Build/Usage Example

cargo rustc --features extension -- --crate-type=cdylib

Load extension from ./target/release/libsignal_tokenizer.dylib.

CREATE VIRTUAL TABLE
fts
USING fts5(content, tokenize='signal_tokenizer')

Generating headers

cbindgen --profile release . -o target/release/fts5-tokenizer.h

Legal things

License

Copyright 2023 Signal Messenger, LLC.

Licensed under the AGPLv3: http://www.gnu.org/licenses/agpl-3.0.html