Python Finite-State Toolkit
Project description
Quickstart
pip install pyfoma
from pyfoma import FST
myfst = FST.re("(cl|n|s)?e(ve|a)r")
myfst.view()
What's new
- Mar 2026: added SKILL.md for creating morphological analyzers
- Mar 2026: added support for parsing and approximation of CFGs
- Feb 2026: pyfoma.js port allows PyFoma regex compilation, visualization, and testing in the browser
- Feb 2026: added support for lexd
Core documentation
- Regular Expression Compiler
- Introduction to lexd
- Morphological Analyzer Tutorial
- CFG Parsing
- CFG Approximation
Contributing
pip install -e .
# Build Cython modules
python setup.py build_ext --inplace
Rebuilding the documentation
brew install sphinx-doc # if not installed
# Update automatically-scraped docs
sphinx-apidoc -o docs src/pyfoma/
# Rebuild docs
cd docs
make html
Citation
@inproceedings{hulden-etal-2024-pyfoma,
title = "{P}y{F}oma: a Python finite-state compiler module",
author = "Hulden, Mans and Ginn, Michael and Silfverberg, Miikka and Hammond, Michael",
editor = "Cao, Yixin and Feng, Yang and Xiong, Deyi",
booktitle = "Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 3: System Demonstrations)",
year = "2024",
address = "Bangkok, Thailand",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2024.acl-demos.24",
doi = "10.18653/v1/2024.acl-demos.24",
pages = "258--265"
}
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
pyfoma-1.1.0.tar.gz
(90.8 kB
view details)
Built Distribution
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 pyfoma-1.1.0.tar.gz.
File metadata
- Download URL: pyfoma-1.1.0.tar.gz
- Upload date:
- Size: 90.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1382ceb7cab9f3edc536f322f33c7d75b5f7ab4d9d7650968166b6912fa09ab
|
|
| MD5 |
2f15952e959cca2fb30b305fea73a1bb
|
|
| BLAKE2b-256 |
67b06074a583986e63c2c7f25bf7d5cd7b8cb2b7220fe445c61babf01117a2a9
|
File details
Details for the file pyfoma-1.1.0-cp310-cp310-macosx_15_0_arm64.whl.
File metadata
- Download URL: pyfoma-1.1.0-cp310-cp310-macosx_15_0_arm64.whl
- Upload date:
- Size: 371.7 kB
- Tags: CPython 3.10, macOS 15.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
809357f17ae9dfd09d7a85eacb0a816caf822d48b37ec7c2672d5fd308fae268
|
|
| MD5 |
99792dabd3bfcc1cbbf8cf5722af2b0a
|
|
| BLAKE2b-256 |
f1e7430cc74c07be203e59015eadb7b2a01b908478c2611b61badc2a62f12ae2
|