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.3-pp311-pypy311_pp73-win_amd64.whl (789.6 kB view details)

Uploaded PyPyWindows x86-64

kfst_rs-0.1.3-pp310-pypy310_pp73-win_amd64.whl (788.4 kB view details)

Uploaded PyPyWindows x86-64

kfst_rs-0.1.3-pp39-pypy39_pp73-win_amd64.whl (788.8 kB view details)

Uploaded PyPyWindows x86-64

kfst_rs-0.1.3-cp313-cp313t-win_arm64.whl (712.0 kB view details)

Uploaded CPython 3.13tWindows ARM64

kfst_rs-0.1.3-cp313-cp313t-win_amd64.whl (793.4 kB view details)

Uploaded CPython 3.13tWindows x86-64

kfst_rs-0.1.3-cp311-abi3-win_arm64.whl (709.0 kB view details)

Uploaded CPython 3.11+Windows ARM64

kfst_rs-0.1.3-cp311-abi3-win_amd64.whl (791.5 kB view details)

Uploaded CPython 3.11+Windows x86-64

kfst_rs-0.1.3-cp311-abi3-musllinux_1_2_x86_64.whl (457.9 kB view details)

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

kfst_rs-0.1.3-cp311-abi3-musllinux_1_2_i686.whl (486.2 kB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ i686

kfst_rs-0.1.3-cp311-abi3-musllinux_1_2_aarch64.whl (434.0 kB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ ARM64

kfst_rs-0.1.3-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (459.2 kB view details)

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

kfst_rs-0.1.3-cp311-abi3-manylinux_2_17_i686.manylinux2014_i686.whl (507.1 kB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ i686

kfst_rs-0.1.3-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (436.8 kB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ ARM64

kfst_rs-0.1.3-cp311-abi3-macosx_11_0_arm64.whl (906.0 kB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

kfst_rs-0.1.3-cp311-abi3-macosx_10_12_x86_64.whl (923.7 kB view details)

Uploaded CPython 3.11+macOS 10.12+ x86-64

File details

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

File metadata

File hashes

Hashes for kfst_rs-0.1.3-pp311-pypy311_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 030c3f0e0915279cd452f548f83873b07eae749939cb93be58237c296f9169b2
MD5 850ac01bec8ed6e05d1b088305d0a777
BLAKE2b-256 447e9390556e9df74d51faf7f26c62f1323117e5916772472a8771218973dce1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kfst_rs-0.1.3-pp310-pypy310_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 7e145cc7b5d534e0001a11a21c6a5cebefa05cb7d5c744299dd00ada00cd8503
MD5 4fd330ab04cef45cd0b65ef9d7408da7
BLAKE2b-256 be8cb22a298402513ad3f0d653008062ef167058d4e6b247e767bf832ccc9462

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kfst_rs-0.1.3-pp39-pypy39_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 7823e5716ef17c59324c4bab5f4bcdd3b07962d0311c48016bfe1487631821e9
MD5 feda79e56b8275dfa371b45260f812d2
BLAKE2b-256 c50f1200bb094c541742f3fb10036fefbdff1e86e5884ba49d92e7c6142df2bb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kfst_rs-0.1.3-cp313-cp313t-win_arm64.whl
  • Upload date:
  • Size: 712.0 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.3-cp313-cp313t-win_arm64.whl
Algorithm Hash digest
SHA256 ff4927c73ad2a4d3b99ec9d065aea0481ea5b37f9665d95772645865c2f4cafb
MD5 91882b0e138d3f0b0f187826010ef2f2
BLAKE2b-256 5a7ec2029a7ac0976353ecee225c7b91a21bb613175eabab10d0f9e18362b460

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kfst_rs-0.1.3-cp313-cp313t-win_amd64.whl
  • Upload date:
  • Size: 793.4 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.3-cp313-cp313t-win_amd64.whl
Algorithm Hash digest
SHA256 376846575d3a4dc75c05e9d8e0ebf3f0ed7a4f070e468dfa3c20986292a53b49
MD5 e55b0e9a5b4832616cdb8af13eb3108f
BLAKE2b-256 261937d2fb9498f23152a5de86bfc4090c05c4ed569e9c76cf5e48fadc06e951

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kfst_rs-0.1.3-cp311-abi3-win_arm64.whl
  • Upload date:
  • Size: 709.0 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.3-cp311-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 0cbe058c0d68e03eb080f73bbc8210b8dde2a6b55dc327d290a79cba3b6e46df
MD5 55b0dc9d00b30cd2fea5ded776ff28d0
BLAKE2b-256 1e748aa221e4aafcd33f9647147e45f2a11677e55d4f369e2b8795e8a4cfe07b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kfst_rs-0.1.3-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 791.5 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.3-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 5f96101b783e5d226ba2d582d665e9e8059f2d8fb2e2edfd004d19b1f983b362
MD5 687963c1015a5561a4134fbb2062b4bd
BLAKE2b-256 9e2cd5888314208309feb2d254ff9332d6c468b717364ef5d89b918481e9ecc0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kfst_rs-0.1.3-cp311-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 bbefe82d03eff7be654ad7ecd27812c872934755d8ec9577dfb171f633b7222d
MD5 6cd26d932ce22fa6533e6e9340ffb037
BLAKE2b-256 680349d9f8b0efd156deca9c88db979f96c0fec8e4a37b6f2ca92773fd4fac9a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kfst_rs-0.1.3-cp311-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 3175aca09bb0dc22c590b93c2ad233bf291a8f17299188051156e5b1cb84db22
MD5 64bebd4098d6c9eb3bacd1b48e8845a9
BLAKE2b-256 7bfae1775849de6d6c4ca08939fc7119e6a0a3925494b94a6b56fa9380b7c641

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kfst_rs-0.1.3-cp311-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 bc76d8282e429b446ab1fe92b0e625e9bc56f15359c26ad46df21b4b9016abf1
MD5 41b4199f150920eb7865149d44d87366
BLAKE2b-256 2ae72070bae18a7394d12d9717e377b2b4418c88ee44168ba9b571777f7d71e5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kfst_rs-0.1.3-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c8ebbe5e16174d5a9755fc8673d8567463e9047ec2277332fd2af9be919a3200
MD5 3b0ce1bc8d346c8152371020d2a9b8fa
BLAKE2b-256 353bb7da704879b13d2fc284ca9af3c6bf381e38aba887529cebc00ce4c19037

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kfst_rs-0.1.3-cp311-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 4cabd649095cf066cd052813dfe07fb8d519c261bf95dc9ae501e8f4ad2c7bea
MD5 0ffee7ae2560f470c6d1e177053f27fe
BLAKE2b-256 d55686c626a8631f78eee93bce4a3217e8398c59cc849f15090969ae5e31b9e9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kfst_rs-0.1.3-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 25c2013dc21e524e28ad311b2cc46e50b8065aaa027437d9e265faebfb4d6cfe
MD5 3584377a4baa59d516658e7d4479db91
BLAKE2b-256 8adfcffda4ae036ef7a415d082985e488015912b869db511745e37b4d62a8e07

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kfst_rs-0.1.3-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 992af09491203882f19a62688bf30f221035b2e29ea06c1a6bc5a3eac3d5dbbd
MD5 7b3462b8ba341e599094d1b450ef3010
BLAKE2b-256 71516858dc9d4030e611b82a7c0738a9547dea076c2b1e60677f30ebb9d71424

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kfst_rs-0.1.3-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 5c7a832c4d5e8aa121b21986f2f7cf51c1acff2921193e2dc2d86bb4cc4621af
MD5 dc33b06522c9d144e83e6f51c8a6b59a
BLAKE2b-256 236d6248808bb4a990160dd6821e7f313bdfe28d5627c89a69250c75c4ca897f

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