Skip to main content

The accelerated companion library to kfst

Project description

kfst-rs

kfst-rs is both the optional acceleration back end of kfst and a self-standing rust implementation of finite-state transducers mostly compatible with HFST. These two functions are liable to being split into multiple crates / packages in the future.

Able to load and execute Voikko and Omorfi: see kfst for transducers converted to a compatible format as well as Python bindings.

Supports the ATT format and its own KFST format. To convert HFST (optimized lookup or otherwise) to ATT using HFST's tools, do:

hfst-fst2txt transducer.hfst -o transducer.att

Using from Python

If you have kfst>=4.1 installed, simply do

pip install kfst-rs

to install kfst-rs. It should get automatically picked up by kfst and by extension pyvoikko and pyomorfi.

To check which implementation of kfst got loaded, look at the BACKEND property of kfst.

Using from rust

Given the Voikko transducer in KFST or ATT format, one could create a simple analyzer like this:

use kfst_rs::{FSTState, FST};
use std::io::{self, Write};
// Read in transducer
let pathtovoikko = ...
let fst = FST::from_kfst_file(pathtovoikko, true).unwrap();
// Alternatively, for ATT use FST::from_att_file
// Read in word to analyze
let mut buffer = String::new();
let stdin = io::stdin();
stdin.read_line(&mut buffer).unwrap();
buffer = buffer.trim().to_string();
// Do analysis proper
match fst.lookup(&buffer, FSTState::default(), true) {
    Ok(result) => {
        for (i, analysis) in result.into_iter().enumerate() {
            println!("Analysis {}: {} ({})", i+1, analysis.0, analysis.1)
        }
    },
    Err(err) => println!("No analysis: {:?}", err),
}

Given the input "lentokoneessa", this gives the following analysis:

Analysis 1: [Lt][Xp]lentää[X]len[Ln][Xj]to[X]to[Sn][Ny][Bh][Bc][Ln][Xp]kone[X]konee[Sine][Ny]ssa (0)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

kfst_rs-0.1.2-pp311-pypy311_pp73-win_amd64.whl (789.9 kB view details)

Uploaded PyPyWindows x86-64

kfst_rs-0.1.2-pp310-pypy310_pp73-win_amd64.whl (788.8 kB view details)

Uploaded PyPyWindows x86-64

kfst_rs-0.1.2-pp39-pypy39_pp73-win_amd64.whl (789.3 kB view details)

Uploaded PyPyWindows x86-64

kfst_rs-0.1.2-cp313-cp313t-win_arm64.whl (712.5 kB view details)

Uploaded CPython 3.13tWindows ARM64

kfst_rs-0.1.2-cp313-cp313t-win_amd64.whl (792.9 kB view details)

Uploaded CPython 3.13tWindows x86-64

kfst_rs-0.1.2-cp311-abi3-win_arm64.whl (709.4 kB view details)

Uploaded CPython 3.11+Windows ARM64

kfst_rs-0.1.2-cp311-abi3-win_amd64.whl (790.9 kB view details)

Uploaded CPython 3.11+Windows x86-64

kfst_rs-0.1.2-cp311-abi3-musllinux_1_2_x86_64.whl (456.7 kB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ x86-64

kfst_rs-0.1.2-cp311-abi3-musllinux_1_2_i686.whl (484.1 kB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ i686

kfst_rs-0.1.2-cp311-abi3-musllinux_1_2_aarch64.whl (433.3 kB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ ARM64

kfst_rs-0.1.2-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (458.0 kB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ x86-64

kfst_rs-0.1.2-cp311-abi3-manylinux_2_17_i686.manylinux2014_i686.whl (505.5 kB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ i686

kfst_rs-0.1.2-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (436.2 kB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ ARM64

kfst_rs-0.1.2-cp311-abi3-macosx_11_0_arm64.whl (904.5 kB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

kfst_rs-0.1.2-cp311-abi3-macosx_10_12_x86_64.whl (922.3 kB view details)

Uploaded CPython 3.11+macOS 10.12+ x86-64

File details

Details for the file kfst_rs-0.1.2-pp311-pypy311_pp73-win_amd64.whl.

File metadata

File hashes

Hashes for kfst_rs-0.1.2-pp311-pypy311_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 eda88c2f5cceefaf60e66434b1d03cb7ee3dda551dc1b3bd7cebd905b6e2b0b8
MD5 20c6a42708c3a1cca303ed6e3305694a
BLAKE2b-256 13793fed0e3ff20a91bf638bb9440455c54de14aeae499f3071e5c7b351e01f9

See more details on using hashes here.

File details

Details for the file kfst_rs-0.1.2-pp310-pypy310_pp73-win_amd64.whl.

File metadata

File hashes

Hashes for kfst_rs-0.1.2-pp310-pypy310_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 ee52d3426228f81c7b655b2fd1bd72af81b2d3d2e04eab94712ad398e4849bb1
MD5 877bf486642e0e07166cb34e7afc295f
BLAKE2b-256 98de4dcd22ab09b4ca22d21dd7342198d29fb5d19126120a257b197879c7e012

See more details on using hashes here.

File details

Details for the file kfst_rs-0.1.2-pp39-pypy39_pp73-win_amd64.whl.

File metadata

File hashes

Hashes for kfst_rs-0.1.2-pp39-pypy39_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 825c11d44df5d4c0f49c45c64a0432127486294c38aeafdab2d81923a80f1e62
MD5 b71d77c9e398980d163cc662a5d44444
BLAKE2b-256 88617f64ae0f4e18547ba3763abba858f2f1d7f03241324e7a47681d9bbb8bba

See more details on using hashes here.

File details

Details for the file kfst_rs-0.1.2-cp313-cp313t-win_arm64.whl.

File metadata

  • Download URL: kfst_rs-0.1.2-cp313-cp313t-win_arm64.whl
  • Upload date:
  • Size: 712.5 kB
  • Tags: CPython 3.13t, Windows ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for kfst_rs-0.1.2-cp313-cp313t-win_arm64.whl
Algorithm Hash digest
SHA256 7092cfb6e34fde30a0c1d2b0393ecb9659e11fe6a79eeb8254f60cf0eba1addd
MD5 76a7ae143a5801067f8227a75c3d9390
BLAKE2b-256 4bdbdfd9f5690293ee88fd09bcfd22bd3be218d2a180f22ada848c80e1e2a9e6

See more details on using hashes here.

File details

Details for the file kfst_rs-0.1.2-cp313-cp313t-win_amd64.whl.

File metadata

  • Download URL: kfst_rs-0.1.2-cp313-cp313t-win_amd64.whl
  • Upload date:
  • Size: 792.9 kB
  • Tags: CPython 3.13t, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for kfst_rs-0.1.2-cp313-cp313t-win_amd64.whl
Algorithm Hash digest
SHA256 bf01bf641b1046e5f7f2b4f02a8ff76b5fae45211281a69cf79a3244f652df32
MD5 f7b50335e8017a414b10556cadd44b8f
BLAKE2b-256 78c0727ae150a4b407edbbdcc246e7a2b48becbc1701632164ec102abeb67bd1

See more details on using hashes here.

File details

Details for the file kfst_rs-0.1.2-cp311-abi3-win_arm64.whl.

File metadata

  • Download URL: kfst_rs-0.1.2-cp311-abi3-win_arm64.whl
  • Upload date:
  • Size: 709.4 kB
  • Tags: CPython 3.11+, Windows ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for kfst_rs-0.1.2-cp311-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 512ef1e077f476d6083a276ab0e9fba58421c6ec99a2460b0410ecc5278e5764
MD5 7926d82dadcb0b7af443a88ea80ef0db
BLAKE2b-256 b442a7a977ec7076bb438fb83551c23cd8266063c11403a2f192981b89bc2edd

See more details on using hashes here.

File details

Details for the file kfst_rs-0.1.2-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: kfst_rs-0.1.2-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 790.9 kB
  • Tags: CPython 3.11+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for kfst_rs-0.1.2-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 d9390c2dc0692c4967ffd9810164beed57f62317a5e341772a0fe3454dc228ba
MD5 4f9a74a09172f42070fc111ca7ed54d3
BLAKE2b-256 a95946225904952f41c1fa0e7e033f83d2d5be06369620faf0bb5af4577e693b

See more details on using hashes here.

File details

Details for the file kfst_rs-0.1.2-cp311-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for kfst_rs-0.1.2-cp311-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 26dcda7ba7f6623832f7bbe6d9052195690f90e2a6637c822ec521ddfbfa8ea6
MD5 94675b09a530682cca4a97eab84ca918
BLAKE2b-256 8e0565a6f9592fff706fe0c544a882f2d3a1fbba2a8ce4dcd8530f8a56901cb9

See more details on using hashes here.

File details

Details for the file kfst_rs-0.1.2-cp311-abi3-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for kfst_rs-0.1.2-cp311-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 50cdd8106364fb0696421acfe2781bc94bcb3db72072259cc7ddb19d16665ea6
MD5 ecdb2c0e5a1cb69fd31bf958495147a2
BLAKE2b-256 8d297f99395e3bc688ffd4b09ce544785749ec43ed2cd22d3136f8ce7b516b03

See more details on using hashes here.

File details

Details for the file kfst_rs-0.1.2-cp311-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for kfst_rs-0.1.2-cp311-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 1c2c2aeb5db1866d0160de1f855f9a927291e2ea714d689a3a6bfed2d021c7f5
MD5 f5be2157a6238a9500cee60f37c682f1
BLAKE2b-256 e6573894607b0362a19ad33a67dc0885f5212e25ad07d16fe730919e17c9c474

See more details on using hashes here.

File details

Details for the file kfst_rs-0.1.2-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for kfst_rs-0.1.2-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7092ad8bc7a214b8c664f78f6cd7ef6122daa712830e7865c981d89351e15670
MD5 740a2e506ff966970880318ca5a8a986
BLAKE2b-256 26d024fd0005566b232a6e40d32e18e4b011a74517bfa9df57b2d6ec6ad732a4

See more details on using hashes here.

File details

Details for the file kfst_rs-0.1.2-cp311-abi3-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for kfst_rs-0.1.2-cp311-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 bf15ce89896dee0f26d16a8fdb42c65b86ae0c783cd8cb8367440ab800656489
MD5 6d2f17a1db761267bb69fbcb5f56929d
BLAKE2b-256 b0c6203e3083b821325b128dbd1fb77595d7c7a5265162646c8b73fa70fb8cd6

See more details on using hashes here.

File details

Details for the file kfst_rs-0.1.2-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for kfst_rs-0.1.2-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 97f79a564822f4b49b7c25e083eaa75b27ee3f361f7ecfd61d27dbf143a631aa
MD5 8775a48bb0505d70d02ad3a098938c6d
BLAKE2b-256 c3a725b3dbbf6f8a29ea2304c0df0cd24f9f11eafd882e3bce15fe62c4306221

See more details on using hashes here.

File details

Details for the file kfst_rs-0.1.2-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for kfst_rs-0.1.2-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 140b120d8016026e4f282a79f49a61991263e74a0ea23a0f9daa4d721cc37046
MD5 6abe5f7be99bb4dfa9aa74b167b1bc1a
BLAKE2b-256 54a79fd520369a45f74dee4aacccd994abdde7d82c6086b945e8bf2117588147

See more details on using hashes here.

File details

Details for the file kfst_rs-0.1.2-cp311-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for kfst_rs-0.1.2-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 841db7231f0863ac731c6271f9d9fe041974fb173dcb2c20d23d899611c50d54
MD5 57c78e829cfbeec04ae055ec7060a30c
BLAKE2b-256 daf04105c16ca5340e41b02df38892fe4b0262b2c03d0dc8afada5c9dfcfc353

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page