Skip to main content

Python bindings for SFST focusing on transducer usage

Project description

sfst-transduce

Python bindings for SFST focusing on transducer usage

PyPI

A Python library providing bindings for the Stuttgart Finite State Transducer system with a focus on the usage of compiled and serialized transducers, excluding code for transducer development and testing, which reduces compile and runtime dependencies.

Should you need the SFST tools for transducer generation, please take a look at their homepage for installation and usage instructions.

Installation

sfst-transduce is available at PyPI:

pip install sfst-transduce

Usage

import sfst_transduce

# Create instance from compiled transducer
transducer = sfst_transduce.Transducer('path/to/fst.a')

# Analysis
analysis_results = transducer.analyse("easier")
# Returns ['easy<ADJ><comp>'] for example.

# Generate a string. results are a list of analysis.
generate_results = transducer.generate("easy<ADJ><comp>")
# Returns ['easier'] for example.

# Create instance from compiled transducer (compacted serialisation)
transducer = sfst_transduce.CompactTransducer('path/to/fst.ca')
# Activate output of aligned input and output layer
transducer.both_layers = True
# Analysis
transducer.analyse('easier')
# Returns ['easy:i<ADJ>:<><comp>:e<>:r'] for example.

Development

rm -rf build ; pip install -e '.[dev]'

Release

scripts/release $NEW_VERSION
git push && git push --tags

Credits

The SFST tools have been implemented by Helmut Schmid, Institute for Computational Linguistics, University of Stuttgart, Germany and they are available under the GNU public license version 2 or higher.

Please cite the following publication if you want to refer to the SFST tools:

Schmid, Helmut. "A programming language for finite state transducers." FSMNLP. Vol. 4002. 2005. pdf

This Python library is a fork of the excellent SFST adaptation by Santhosh Thottingal, changing the focus of the Python part.

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

sfst-transduce-1.0.2.tar.gz (83.1 kB view hashes)

Uploaded Source

Built Distributions

sfst_transduce-1.0.2-pp37-pypy37_pp73-win_amd64.whl (124.1 kB view hashes)

Uploaded PyPy Windows x86-64

sfst_transduce-1.0.2-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (399.4 kB view hashes)

Uploaded PyPy manylinux: glibc 2.12+ x86-64

sfst_transduce-1.0.2-pp37-pypy37_pp73-manylinux_2_12_i686.manylinux2010_i686.whl (426.2 kB view hashes)

Uploaded PyPy manylinux: glibc 2.12+ i686

sfst_transduce-1.0.2-cp39-cp39-win_amd64.whl (125.5 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

sfst_transduce-1.0.2-cp39-cp39-win32.whl (101.1 kB view hashes)

Uploaded CPython 3.9 Windows x86

sfst_transduce-1.0.2-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (401.4 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

sfst_transduce-1.0.2-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl (428.7 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.12+ i686

sfst_transduce-1.0.2-cp39-cp39-macosx_10_9_x86_64.whl (273.9 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

sfst_transduce-1.0.2-cp38-cp38-win_amd64.whl (125.2 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

sfst_transduce-1.0.2-cp38-cp38-win32.whl (100.9 kB view hashes)

Uploaded CPython 3.8 Windows x86

sfst_transduce-1.0.2-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (400.8 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

sfst_transduce-1.0.2-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl (428.2 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ i686

sfst_transduce-1.0.2-cp38-cp38-macosx_10_9_x86_64.whl (273.4 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

sfst_transduce-1.0.2-cp37-cp37m-win_amd64.whl (124.5 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

sfst_transduce-1.0.2-cp37-cp37m-win32.whl (100.5 kB view hashes)

Uploaded CPython 3.7m Windows x86

sfst_transduce-1.0.2-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (401.3 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

sfst_transduce-1.0.2-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.whl (430.0 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ i686

sfst_transduce-1.0.2-cp37-cp37m-macosx_10_9_x86_64.whl (272.5 kB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

sfst_transduce-1.0.2-cp36-cp36m-win_amd64.whl (124.3 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

sfst_transduce-1.0.2-cp36-cp36m-win32.whl (100.2 kB view hashes)

Uploaded CPython 3.6m Windows x86

sfst_transduce-1.0.2-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (401.1 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

sfst_transduce-1.0.2-cp36-cp36m-manylinux_2_12_i686.manylinux2010_i686.whl (430.1 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ i686

sfst_transduce-1.0.2-cp36-cp36m-macosx_10_9_x86_64.whl (272.3 kB view hashes)

Uploaded CPython 3.6m macOS 10.9+ x86-64

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