Tact Dictionary builds, validates, and queries .tactdict language packs for
text-entry software.
The tact-dictionary tool and related Python package can prepare source data,
build binary packs, validate pack files, and inspect completions and variants.
The project was built with the Tact Android keyboard in mind, but the keyboard
is an adopter of the format rather than the only intended consumer. Current
packs contain a normalized lexicon graph, word records, prefix suggestion
caches, and variant groups for long-press word alternatives.
The tool and Python package are licensed under the MIT License. Generated language packs are data artifacts with source-derived licensing and attribution recorded in the sidecar manifest. The code license does not relicense frequency lists, morphology data, blocklists, or other input datasets.
This project is pre-alpha. The tool can produce and validate an English pack, and the Python API can inspect completions and variants.
Implemented pack sections:
STRINGS: shared UTF-8 string poolSYMBOLS: normalized input symbolsWORDS: word records and source masksVARIANTS: variant groups such asrun,runs,running,runnerSUGGESTS: prefix suggestion lists attached to graph statesGRAPH: lexicon word graph
Not implemented yet: context models, full typo-correction graph data, blocklist sections, user overlays, and runtime memory-map readers.
uv sync
uv run tact-dictionary --version
uv run ruff format --check src tests
uv run ruff check
uv run pytestBuild Python distribution artifacts with:
uv buildDownload the current English source files:
- Leipzig Corpora Collection English news corpus: https://downloads.wortschatz-leipzig.de/corpora/eng_news_2025_100K.tar.gz
- Tact Word Families English variants: https://github.com/tact-tools/tact-word-families/releases/download/v0.1.0/variants.tsv
Convert external source files into tact-dictionary build inputs:
uv run tact-dictionary import-language-data \
--output-dir build/en_US \
--leipzig-corpus sources/eng_news_2025_100K.tar.gz \
--variants sources/variants.tsvBuild and validate the pack:
uv run tact-dictionary build --config build/en_US/en_US.tactbuild
uv run tact-dictionary validate build/en_US/generated/en_US.tactdictThe build writes:
build/en_US/generated/en_US.tactdictbuild/en_US/generated/en_US.manifest.jsonbuild/en_US/generated/en_US.symbols.json
See Building Language Packs for input file formats and build configuration details.
Python consumers can inspect a built pack without shelling out:
from tact_dictionary.query import DictionaryLookup
lookup = DictionaryLookup.from_file("en_US.tactdict")
for completion in lookup.find_completions("ru"):
print(completion.surface, completion.kind, completion.completion_cost)
for variant in lookup.find_variants("run"):
print(variant.surface, variant.relation_to_primary)The same lookup is available from the CLI:
tact-dictionary --file en_US.tactdict find-completions --limit 12 ru
tact-dictionary --file en_US.tactdict find-variants run