Skip to main content

Python bindings for Foma

Project description

foma-py

Python bindings for Foma

This is a foma interface implemented in Python. Requires libfoma installed.

Installation

From PyPI:

pip install foma

From source:

git clone https://github.com/GooDeeJaY/foma-py.git
cd foma-py
python -m pip install .

Basic usage

from foma import FST

fst = FST.load("path_to_model")

fst.apply_up("example")
fst.apply_down("example")

Other modules:

attapply

This is a stand-alone Python utility for reading AT&T files and applying transductions. Useful for minimizing dependencies. Also supports weighted transducers, in which case apply() returns output strings in least-cost order.

TODO: Add basic usage

phonrule

This is a simple helper tool for debugging foma-scripts that are sequences of phonological rules meant to apply in a certain order. It assumes a grammar is written as a sequence of define-statements and ordered rewrite-rules combined with a chain-statement (simulating composition of the rules). It then passes words from STDIN through the sequence of transducers and prints a decorated output to STDOUT where rules that fire are shown between brackets.

TODO: Add basic usage

foma2js

This is a port of foma/contrib/foma2js.perl to Python 3. Get the help using foma2js.py -h. Everything else like in the original program.

TODO: Add basic usage


Forked from mhulden/foma/python

Project details


Download files

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

Source Distribution

foma-1.0.0.tar.gz (12.9 kB view hashes)

Uploaded Source

Built Distribution

foma-1.0.0-py3-none-any.whl (13.2 kB view hashes)

Uploaded Python 3

Supported by

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