charsplit-fst
A memory-efficient Rust port of the CharSplit algorithm for German compound splitting, using Finite State Transducers (FST).
Overview
Charsplit-fst implements the CharSplit algorithm for splitting German compound words into their component parts. It achieves 89% memory reduction compared to the original Python implementation by using Finite State Transducer (FST) data structures.
Based on CharSplit by Don Tuggener: https://github.com/dtuggener/CharSplit
Features
- 51% smaller data files: 39 MB JSON → 18.2 MB FST
- 89% lower memory usage: 19.6 MB vs 180 MB runtime
- UTF-8 safe: Proper character-based indexing for German Unicode characters
- Python bindings via PyO3
- WebAssembly demo for browser-based usage
- CLI tool for batch processing
Installation
Python
Available on PyPI.
pip install charsplit-fst
Rust
cargo add charsplit-fst
Quick Start
Python
from charsplit_fst import Splitter
splitter = Splitter()
results = splitter.split_compound("Autobahnraststätte")
# Returns: [(0.795, 'Autobahn', 'Raststätte'), ...]
Rust
use charsplit_fst::Splitter;
let splitter = Splitter::new()?;
let results = splitter.split_compound("Autobahnraststätte");
CLI
cargo run --bin charsplit-fst -- Autobahnraststätte
Algorithm
The algorithm splits German compounds using ngram probability scoring:
Score formula: start_prob - in_prob + pre_prob
Where:
start_prob: Maximum prefix probability of second partin_prob: Minimum infix probability crossing split boundarypre_prob: Maximum suffix probability of first part
Performance
- Memory: 19.6 MB RSS (vs 180 MB for Python)
- Data size: 18.2 MB on disk (vs 39 MB JSON)
Web Demo
A browser-based demo using WebAssembly is available in web-demo/.
# Build the WASM version
./build-wasm.sh
# Serve from project root
python -m http.server 8000
# Open http://localhost:8000/web-demo/
The demo runs entirely in the browser using WebAssembly. No server-side processing is required. Browser support: The demo will try to use Brotli compression via DecompressionStream API where supported, falling back to uncompressed data for browsers that don't support it. Works in all modern browsers.
Development
# Build
cargo build --release
# Run tests
cargo test
# Build Python bindings
maturin develop
# Build WASM
./build-wasm.sh
Acknowledgments
This project is a Rust port of CharSplit by Don Tuggener.
- Algorithm: Based on Tuggener (2016), Incremental Coreference Resolution for German, University of Zurich.
- Original Implementation: dtuggener/CharSplit (https://github.com/dtuggener/CharSplit) (MIT Licensed).
- Data: The n-gram probabilities are derived from the model provided by the original author.
License
MIT OR Apache-2.0
See LICENSE-MIT and LICENSE-APACHE-2.0 for details.
Metadata
Release files for charsplit-fst 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| charsplit_fst-0.1.4.tar.gz | 8.8 MB | With provenance | Details for charsplit_fst-0.1.4.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| charsplit_fst-0.1.4-cp312-abi3-win_amd64.whl | CPython 3.12 | abi3 | Windows x86-64 | Details for charsplit_fst-0.1.4-cp312-abi3-win_amd64.whl |
| charsplit_fst-0.1.4-cp312-abi3-musllinux_1_2_x86_64.whl | CPython 3.12 | abi3 | Linux musl 1.2+ x86-64 | Details for charsplit_fst-0.1.4-cp312-abi3-musllinux_1_2_x86_64.whl |
| charsplit_fst-0.1.4-cp312-abi3-manylinux_2_28_x86_64.whl | CPython 3.12 | abi3 | Linux glibc 2.28+ x86-64 | Details for charsplit_fst-0.1.4-cp312-abi3-manylinux_2_28_x86_64.whl |
| charsplit_fst-0.1.4-cp312-abi3-macosx_11_0_arm64.whl | CPython 3.12 | abi3 | macOS 11.0+ ARM64 | Details for charsplit_fst-0.1.4-cp312-abi3-macosx_11_0_arm64.whl |
Total release size: 44.9 MB
Release files / charsplit_fst-0.1.4.tar.gz
| Download URL | charsplit_fst-0.1.4.tar.gz |
|---|---|
| Size | 8.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0365f37c98180c25289d8a21e056c192fb130467d3289dbee2ebde533d7ed3a3
|
|
BLAKE2b-256 checksum How to use checksums |
c191cdb2672df6ccfeeee6927f5f4ac991515f37fce1a1620580697baaabc30a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 20, 2026.
Transparency logRelease files / charsplit_fst-0.1.4-cp312-abi3-win_amd64.whl
| Download URL | charsplit_fst-0.1.4-cp312-abi3-win_amd64.whl |
|---|---|
| Size | 8.9 MB |
| Tags | CPython 3.12 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
e4946737d5bc751385af6c8e4f96ecf9dca96022b20005cda0c054410438d0b5
|
|
BLAKE2b-256 checksum How to use checksums |
97136cd4ddc55bc03c9baabecaf68ce12a0460d8589e6093683962c6e123ee62
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 20, 2026.
Transparency logRelease files / charsplit_fst-0.1.4-cp312-abi3-musllinux_1_2_x86_64.whl
| Download URL | charsplit_fst-0.1.4-cp312-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 9.1 MB |
| Tags | CPython 3.12 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
c2a3330354c58d9d5d3aae291512850fcd44d9e3f0937ae14769d7e32e08ee5f
|
|
BLAKE2b-256 checksum How to use checksums |
a80f13454510076b4154a18c16d96d1041aac12550fb62fa7e045de4da55ba8f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 20, 2026.
Transparency logRelease files / charsplit_fst-0.1.4-cp312-abi3-manylinux_2_28_x86_64.whl
| Download URL | charsplit_fst-0.1.4-cp312-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 9.0 MB |
| Tags | CPython 3.12 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
e72bf11e0bd6b92ec50326d58ce4d74bd0fbb7ee695dd5bba923faf1f3dbc351
|
|
BLAKE2b-256 checksum How to use checksums |
33a379046534d66ce3935eade88e57d98bf5d92b3e02793a77821cf079e81aeb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 20, 2026.
Transparency logRelease files / charsplit_fst-0.1.4-cp312-abi3-macosx_11_0_arm64.whl
| Download URL | charsplit_fst-0.1.4-cp312-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 9.1 MB |
| Tags | CPython 3.12 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
bf868474c131b79bf341e3025ea0bf0366f56b16b76643f106a9a15d45113c77
|
|
BLAKE2b-256 checksum How to use checksums |
83b9ca3951cd55181b37b76131f1a4f53fbb3a531ddc5526de423586100c673c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 20, 2026.
Transparency logSecurity for charsplit-fst 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 5 files in this release have been uploaded with provenance metadata.
Attestation for charsplit_fst-0.1.4.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 20, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.