Phonetisaurus G2P inference, pure-Rust implementation with Python bindings
Project description
Phonetisaurus G2P inference, pure-Rust implementation. Ships as a Python package, a Rust crate (with a CLI), and a WASM module — same algorithm, four distribution targets.
Install
# pypi
pip install sosap
# GitHub
pip install git+https://github.com/seanghay/sosap.git
Phoneticize
from sosap import Model
model = Model("g2p.fst")
model.phoneticize("hello")
# => ['h', 'ɛɛ', 'l', 'oo']
N-best sampling
from sosap import Model
model = Model("g2p.fst")
results = model.phoneticize_sampling("hello", nbest=4)
# => [['h', 'ɛɛ', 'l', 'oo'], ['h', 'ee', '.', 'l', 'oo'], ['h', 'ɛɛ', '.', 'l', 'oo'], ['h', 'ɛɛ', 'l', '.', 'l', 'ɔɔ']]
results = model.phoneticize_sampling("hello", nbest=4, beam=1000, threshold=99.0, pmass=99.0)
For full access to the underlying PhonetisaurusScript interface (per-arc weights, raw input/output labels, accumulate/pmass modes), use model.phoneticize_paths(word, ...) which returns PathData objects with .path_weight, .path_weights, .ilabels, .olabels, .uniques.
Other targets
- Rust crate at
rust/—cargo build --releaseproduces a CLI (sosap <model.fst> <word>) and arustfst-compatible library. - WebAssembly —
cd rust && wasm-pack build --target web --release --no-default-features --no-typescriptbuilds a browser-ready bundle inrust/pkg/. TheModelclass accepts the FST as raw bytes (new Model(uint8Array, "")).
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sosap-0.4.3.tar.gz.
File metadata
- Download URL: sosap-0.4.3.tar.gz
- Upload date:
- Size: 16.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b848c6b532473aefaf32eede69b6d2032de484511ff34c2cba0413465f3d9de9
|
|
| MD5 |
9169300f18b5bc61f74feef8b5ec012e
|
|
| BLAKE2b-256 |
0194a221bf817f7f597f56134b05c936b6b1673bdef150ef65a8da4d5d9fa2b4
|
File details
Details for the file sosap-0.4.3-cp314-cp314-win_amd64.whl.
File metadata
- Download URL: sosap-0.4.3-cp314-cp314-win_amd64.whl
- Upload date:
- Size: 282.7 kB
- Tags: CPython 3.14, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2bf09d132530205c266e802a401af18b783413c3a1b1c5b38029ee4bcad56338
|
|
| MD5 |
06c155202184a384bdaf013c292464ef
|
|
| BLAKE2b-256 |
40829a3bb95f4cc618a6ac2cf442cceac2b3b5effe70cd09b9383a2f8c97702a
|
File details
Details for the file sosap-0.4.3-cp314-cp314-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: sosap-0.4.3-cp314-cp314-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 591.1 kB
- Tags: CPython 3.14, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f682f58c093b0d883af3d67bea20b858956965c01fa9c13d7fadcae5631b23df
|
|
| MD5 |
678970d82c42fcdc88e5853560e4d10b
|
|
| BLAKE2b-256 |
6d7ec6ddf8dda3a94a278b7ca84a00b1c2963fa9002121aee8f90f6a8ac294c9
|
File details
Details for the file sosap-0.4.3-cp314-cp314-musllinux_1_2_aarch64.whl.
File metadata
- Download URL: sosap-0.4.3-cp314-cp314-musllinux_1_2_aarch64.whl
- Upload date:
- Size: 543.0 kB
- Tags: CPython 3.14, musllinux: musl 1.2+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57085c686ec3101f7bab8afb077c726618177c42a72e4c429e739de4aae4d175
|
|
| MD5 |
8f92d75e6746c1d3df38d1f9644f1bb8
|
|
| BLAKE2b-256 |
4d9beb30b551d03476bc9fe613eedd0d3624c65512cda7ac8504b20c421b21e2
|
File details
Details for the file sosap-0.4.3-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: sosap-0.4.3-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 388.1 kB
- Tags: CPython 3.14, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9dc2cb457f374b09208a37aeb72d097b96b2a5ccccd9a0f07c4a61d6730b43ad
|
|
| MD5 |
dfb4ae4ffc0295f8c9d7d5bf1b16dfaf
|
|
| BLAKE2b-256 |
eb79f06f3485b55305bc8bc680b06e40159f7411f3149d8fbfb0aeed185d8366
|
File details
Details for the file sosap-0.4.3-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: sosap-0.4.3-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 366.2 kB
- Tags: CPython 3.14, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ca265beefcaa7f186b33c1cd96204845b1a7955bf646996f7e22683b8773c83
|
|
| MD5 |
bd5886bb68830d904f3cb61b1ee19432
|
|
| BLAKE2b-256 |
9e57738820e4b83fabce25060a9cfe0e0b149e692ba65a60d19d0fd315656d21
|
File details
Details for the file sosap-0.4.3-cp314-cp314-macosx_11_0_arm64.whl.
File metadata
- Download URL: sosap-0.4.3-cp314-cp314-macosx_11_0_arm64.whl
- Upload date:
- Size: 346.3 kB
- Tags: CPython 3.14, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ab7ff16fc9d126232ddab8828d13c573e8612cba07302429778400e12550887
|
|
| MD5 |
2335bb9bccca82ff325385802428a0a6
|
|
| BLAKE2b-256 |
557bcee69f29d7981cc289aca4fe1e0681178386daa8dddbe6c4d5f3b6ad4ae9
|
File details
Details for the file sosap-0.4.3-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: sosap-0.4.3-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 282.7 kB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe5f2d64cae8690f8c3d5ec989c36caed1a112bae50d2abc5fc4f32198422d35
|
|
| MD5 |
1103243a19ae27abb081d6a9f45f5944
|
|
| BLAKE2b-256 |
b97b3db0d561c827333b2c711a700c58280e595281a94f15b2011152548b7499
|
File details
Details for the file sosap-0.4.3-cp313-cp313-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: sosap-0.4.3-cp313-cp313-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 590.9 kB
- Tags: CPython 3.13, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d9f2b4c67213f2feaa149a5af15504a22540707de871ba41baab79f8a0ed97e
|
|
| MD5 |
0b19034bffd9dd54d0b951c054dbc4ef
|
|
| BLAKE2b-256 |
4013d54b766ad2f9bf172a962d6afe8a18a62c75d96f18025379bc2818620163
|
File details
Details for the file sosap-0.4.3-cp313-cp313-musllinux_1_2_aarch64.whl.
File metadata
- Download URL: sosap-0.4.3-cp313-cp313-musllinux_1_2_aarch64.whl
- Upload date:
- Size: 544.2 kB
- Tags: CPython 3.13, musllinux: musl 1.2+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
733453bbe0027847537467959562f4bc1a2f1bef8b4ec660e9db342bceec054c
|
|
| MD5 |
dc543ae7e6ad733e345232cada40bdb6
|
|
| BLAKE2b-256 |
0ad6c7db709f6623e6cf71dec3d64eebd9e2e9c1ea7180c51a817069f5d0ccd0
|
File details
Details for the file sosap-0.4.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: sosap-0.4.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 388.0 kB
- Tags: CPython 3.13, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
905b6ed711707875929dd204b1a9e050a8ac3079bba9cacfb708650711e0bd8f
|
|
| MD5 |
f12e8d66174b7c967905424791df61b0
|
|
| BLAKE2b-256 |
c941f79bb46e1853612ef970173e5c920a85d2e1dc1f11b51eccaa9f8aa7853a
|
File details
Details for the file sosap-0.4.3-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: sosap-0.4.3-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 367.5 kB
- Tags: CPython 3.13, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
97902ede68fe7be7b98772e75acf1150666dd2049dde9376381222132cf6e098
|
|
| MD5 |
a13e4ace1cca708971d15932b82dedf4
|
|
| BLAKE2b-256 |
cd7c24b801280a51a1fdb614eb8fa73bc358b4c10d45f187e3fb4c67ed333785
|
File details
Details for the file sosap-0.4.3-cp313-cp313-macosx_11_0_arm64.whl.
File metadata
- Download URL: sosap-0.4.3-cp313-cp313-macosx_11_0_arm64.whl
- Upload date:
- Size: 346.0 kB
- Tags: CPython 3.13, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
005ffcd69e2d2fada0d4a2c8e498ea404bdfa806ee7419e37977a0f2dc607391
|
|
| MD5 |
0fb29c25228ce3ee9e5f8ca78111313a
|
|
| BLAKE2b-256 |
4ac06e2b22a5c415b8d82ba9054ec3c1ef5b475a918cebaa4a960a31167c33de
|
File details
Details for the file sosap-0.4.3-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: sosap-0.4.3-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 282.9 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e9cd1f1f1ad774a0911ae9ec861e59101282613444582050de031841eb2789f
|
|
| MD5 |
f67a620440a7f11940f67c66a5ba295d
|
|
| BLAKE2b-256 |
cadfd7067c42bba6ce274ce196b081d545de3aa99c18a888973a4e1aa24ed4ef
|
File details
Details for the file sosap-0.4.3-cp312-cp312-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: sosap-0.4.3-cp312-cp312-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 592.1 kB
- Tags: CPython 3.12, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22a91e74f6f3b80bfc50fc8b362b1160ec0bc237ad46230e360c0fa5e14232fb
|
|
| MD5 |
7fd386791483a83fe9793eaf74939eec
|
|
| BLAKE2b-256 |
fe7beb6805349dd98b66787589a088b3039663198c340456de1752cd36e6b2b9
|
File details
Details for the file sosap-0.4.3-cp312-cp312-musllinux_1_2_aarch64.whl.
File metadata
- Download URL: sosap-0.4.3-cp312-cp312-musllinux_1_2_aarch64.whl
- Upload date:
- Size: 544.3 kB
- Tags: CPython 3.12, musllinux: musl 1.2+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
edb9b38fe5c6c2b9949c1b9a0b0f2664761b146241b225b4ca8e4462b8f50c5b
|
|
| MD5 |
ad2acbdc808dac21c22bbddd7f43c79e
|
|
| BLAKE2b-256 |
799bb8839ef641c3f17817865ad860472e647a8c6f6103399bb5f64a07b2b17c
|
File details
Details for the file sosap-0.4.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: sosap-0.4.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 389.0 kB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
492a882ad72efeb9df91735c787e9cbf2eab895caa9af245835ff15c908a659d
|
|
| MD5 |
edbcf9836ca9e768d436c8761e88eb69
|
|
| BLAKE2b-256 |
947fa09d57c17e1af6b5a9ecc6a7e976edc0dea67f95350a3b2480f1bc8e940d
|
File details
Details for the file sosap-0.4.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: sosap-0.4.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 367.7 kB
- Tags: CPython 3.12, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92720b4cb4fbc22e0534d1e4d40ffaf4b546c40986049e87bf24870238bcbedc
|
|
| MD5 |
8c1ebe124b9f43a5dc6b0d8522c0271c
|
|
| BLAKE2b-256 |
e998c34d19512994864f60dac52814017f61b80987563df31d93a86bb4378c4f
|
File details
Details for the file sosap-0.4.3-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: sosap-0.4.3-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 346.4 kB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5540ec12bcd7348f36d723271df93ba428bdc1b8dca6b9a40ab9410e1eb0399e
|
|
| MD5 |
302332b7cfa39d5fdb16aca3163e371a
|
|
| BLAKE2b-256 |
e19c28cfb7204195d508c58c49c90d3e1badb65175d97814747bfc38f380d16f
|
File details
Details for the file sosap-0.4.3-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: sosap-0.4.3-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 285.6 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
25434b320a3f64b06a6209485928d17a4f1c6fe48db0710faddee6e5f4968561
|
|
| MD5 |
812e215fa560c4c47e8fffdcef14660f
|
|
| BLAKE2b-256 |
30b68d6f5e1508241e9a210b329eecab2f7cb1330bce0d2b7b97f1891d4862d5
|
File details
Details for the file sosap-0.4.3-cp311-cp311-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: sosap-0.4.3-cp311-cp311-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 594.6 kB
- Tags: CPython 3.11, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
496152cfe337b42a4ca656f2c60ea7f158bdda829859998ff0552bedeaa988fa
|
|
| MD5 |
31894af886b945eaf07967722403d56a
|
|
| BLAKE2b-256 |
b5f3b3727f5a8b22883c0e6a0a723e4873064c50c87fab1873322c4a854b89ae
|
File details
Details for the file sosap-0.4.3-cp311-cp311-musllinux_1_2_aarch64.whl.
File metadata
- Download URL: sosap-0.4.3-cp311-cp311-musllinux_1_2_aarch64.whl
- Upload date:
- Size: 546.9 kB
- Tags: CPython 3.11, musllinux: musl 1.2+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d113a3a5bc52ca488ce2f011dfb8dd4a14af9ce3bf39d3ccd007d12baeab75d
|
|
| MD5 |
a1fe280e6b6dd3b3a1753fba3a859f83
|
|
| BLAKE2b-256 |
55d6c23a40be3d5ba5970d86da4c92cacec3079f000b7806834ec03ef7e8d9fe
|
File details
Details for the file sosap-0.4.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: sosap-0.4.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 391.3 kB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
48b501703d7b9bc5598e8b684fa90c8fb5c7a747512e74268f1030bf75d70fff
|
|
| MD5 |
63d88eb4321ce542441fcc86c87ce766
|
|
| BLAKE2b-256 |
a915820f3d9370371d57f4fd4ec215b539b5c8cfe76a05af43300aed48c3c530
|
File details
Details for the file sosap-0.4.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: sosap-0.4.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 371.1 kB
- Tags: CPython 3.11, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6fa6d2eb312f13a98257bfa8eb3abe267fdf80eb29c433f6fe87969bda2cc14f
|
|
| MD5 |
f549e08bdf2a4789df0f98ad97c7098a
|
|
| BLAKE2b-256 |
7536c256139610b1f15946478bc8cd257c91f3acb6598110bc101d74fd5b7008
|
File details
Details for the file sosap-0.4.3-cp311-cp311-macosx_11_0_arm64.whl.
File metadata
- Download URL: sosap-0.4.3-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 347.9 kB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f429ec14c45707e97612f8d6495987a17ce710fcc7c330fd611066445ebad05a
|
|
| MD5 |
8dc2207a6d35d3efab2f61be79b0aa6a
|
|
| BLAKE2b-256 |
3d833f319ef9105a21871b1cfca42c9cff095057eff3d78f398600044e87ed67
|