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 = "../pyvoikko/pyvoikko/voikko.kfst".to_string();
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.1-pp311-pypy311_pp73-win_amd64.whl (789.8 kB view details)

Uploaded PyPyWindows x86-64

kfst_rs-0.1.1-pp310-pypy310_pp73-win_amd64.whl (788.6 kB view details)

Uploaded PyPyWindows x86-64

kfst_rs-0.1.1-pp39-pypy39_pp73-win_amd64.whl (788.9 kB view details)

Uploaded PyPyWindows x86-64

kfst_rs-0.1.1-cp313-cp313t-win_arm64.whl (712.4 kB view details)

Uploaded CPython 3.13tWindows ARM64

kfst_rs-0.1.1-cp313-cp313t-win_amd64.whl (793.7 kB view details)

Uploaded CPython 3.13tWindows x86-64

kfst_rs-0.1.1-cp311-abi3-win_arm64.whl (709.3 kB view details)

Uploaded CPython 3.11+Windows ARM64

kfst_rs-0.1.1-cp311-abi3-win_amd64.whl (790.8 kB view details)

Uploaded CPython 3.11+Windows x86-64

kfst_rs-0.1.1-cp311-abi3-musllinux_1_2_x86_64.whl (456.4 kB view details)

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

kfst_rs-0.1.1-cp311-abi3-musllinux_1_2_i686.whl (482.7 kB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ i686

kfst_rs-0.1.1-cp311-abi3-musllinux_1_2_aarch64.whl (433.2 kB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ ARM64

kfst_rs-0.1.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (457.7 kB view details)

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

kfst_rs-0.1.1-cp311-abi3-manylinux_2_17_i686.manylinux2014_i686.whl (503.6 kB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ i686

kfst_rs-0.1.1-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (435.9 kB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ ARM64

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

Uploaded CPython 3.11+macOS 11.0+ ARM64

kfst_rs-0.1.1-cp311-abi3-macosx_10_12_x86_64.whl (921.8 kB view details)

Uploaded CPython 3.11+macOS 10.12+ x86-64

File details

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

File metadata

File hashes

Hashes for kfst_rs-0.1.1-pp311-pypy311_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 f2b404ee4fcda0500d7ad39688c609ffb8d41c6e499f752d556caf4e5314e2b5
MD5 6889d2226f06b90bfdf198fddaa3777e
BLAKE2b-256 29a5238edacc6b9180d8374fd620a159f39a006fcc7bb87362ef845eb51b4b42

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kfst_rs-0.1.1-pp310-pypy310_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 296852bf333cc46e19e2ffbd4e4042009963038e14001f14c7cd7fbb64916982
MD5 deb85c1f3665fc271ed1c2942d90c112
BLAKE2b-256 429a6d6930225dc3e9f3919fa40ce5d657850b6c8a50b662c8fa8be44ec07a9f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kfst_rs-0.1.1-pp39-pypy39_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 861f53353bcd45f66d281e64aaa96e5dfd0d95b7bc12d589ba3bbbeedb2df3ca
MD5 63a709e9c3881b9eadc8777bdd6d6a8c
BLAKE2b-256 33542c7c3794e879d5e2c866659fa1f8e00567edfdb4577f65e1820b19f17aea

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kfst_rs-0.1.1-cp313-cp313t-win_arm64.whl
  • Upload date:
  • Size: 712.4 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.1-cp313-cp313t-win_arm64.whl
Algorithm Hash digest
SHA256 286c736313e504f033d4977a9641c34ed4553ac6eb1166d735ad29b5c70f4194
MD5 d573f9821de9d14b01c6f00d7ef97250
BLAKE2b-256 0946ae9118e937db80ed9111a2f855f70ac3fb5b8da33ceb32934052f0a2f10b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kfst_rs-0.1.1-cp313-cp313t-win_amd64.whl
  • Upload date:
  • Size: 793.7 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.1-cp313-cp313t-win_amd64.whl
Algorithm Hash digest
SHA256 1a3f15382f2333291a62fd9db96fd0cce788391f4a254a0bf340daa6758994c9
MD5 942d2878e417c738fec8a130d8073fcd
BLAKE2b-256 61dc9facb5d948e88b609700d751ef03dfdea4cab9293ad1261ba1fd5d309bb5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kfst_rs-0.1.1-cp311-abi3-win_arm64.whl
  • Upload date:
  • Size: 709.3 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.1-cp311-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 a0c35dfde6dc164872b1790a5908a8884041b3146a8712e1480cc68ce9f18a08
MD5 64c9ac48ba5f1045afb45b2109a6228a
BLAKE2b-256 f828d0f5704d1b602a99abe4ae4f2027ee448c1b117b3200b984e4ac5b0cb6ae

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kfst_rs-0.1.1-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 790.8 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.1-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 764ec46ebf4cb27523184c58050742bd804036f415cf3ad5a7924e2bdf6c9a0f
MD5 fb962c12ae16e1c9fb1d3feadc2a9909
BLAKE2b-256 ffb43440f4250e915a121c3d4455db4546891536d43034aa21ab42fd174c89b8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kfst_rs-0.1.1-cp311-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 e8ea553d253a1d7599a2f0b2d55c1809a6da564895042303adb8eb884dd64b85
MD5 d589bf91e55ea30288c4ac83de88d86a
BLAKE2b-256 1d096cdfdee780c2a98582570f8a6f27ca4132df96c2319aa8f142d2c2b5a199

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kfst_rs-0.1.1-cp311-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 a590d87c9f4c12c9bba27f871f247d57017e34585d066aec062fca98df1a6785
MD5 a92f4b97777437534d21b54eb6883935
BLAKE2b-256 e1a6ac24907ca97242c5973739598af1dccb8914b76a0b506c8b2b48b1845759

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kfst_rs-0.1.1-cp311-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 2294a44b817d4b2acafc9956bc57e12f1994076ae083cd69d5aa9260cbf1ebc7
MD5 4a94883fd8d0285d0579bdcac5e84b8d
BLAKE2b-256 e6377b89ee95242676339ef2d4f0e42717f505e04287228f58a6824d31c3389e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kfst_rs-0.1.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b3bc06ee826c50b78642362dace13820d5914d2371fcf1743497c25b5c182a7d
MD5 8c91483a9ee6c96decc6f1979c1568af
BLAKE2b-256 5cfa414bdff0f5484153150cbff5e5cc2b25f6f4ddf8de9586eed304408085a7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kfst_rs-0.1.1-cp311-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 8441e405a579feb6cd7d4a138dffabfa58c9b459bec5bee68a347ac321399a46
MD5 4f0f268a777b63c989517ff8347a5ce8
BLAKE2b-256 29b349128514b9a4e3666832aa292eef52ed61b1431a34aefe8cf00f7b5f0ea3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kfst_rs-0.1.1-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5a41af648d4cb1531e38b2182f5ded9c1a03c8d813abc3cb79d1c26e9511a1a9
MD5 fd8eeee8db6312a8f29e46d88a899efe
BLAKE2b-256 b7f78f7aad0b1f162989e14dbbb396385e7f5e0dc442ed241d598c9da7ec33e6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kfst_rs-0.1.1-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 11f6a813ecd31241ad9daceb41df203c9677b196a6badee8cdc8a4ab53722b4e
MD5 3796c7c008ef6ca4ae835fb446373927
BLAKE2b-256 5f54034ecb2cd3b5bb9b51924b4b4f9bf55cb5020e38ef54095dc344daf63397

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kfst_rs-0.1.1-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 c6bcddcb144c886f9eb9f85608592ea138e49a4f7078bb5308f27c52a5cfcf77
MD5 5193cfab24b09e2e9f0319c3ad39466f
BLAKE2b-256 bca2ee1caac3fa50247309d6865f5d2ac7704aa6ef1619fee846134cf21c3632

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