Code Monkey home page Code Monkey logo

openfst-python's Introduction

OpenFst-Python

Build Status Python Version Code Style

OpenFst-Python exposes the official Python API to OpenFst (officially called pywrapfst), but includes all the required OpenFst libraries in the Python package, so you don't need to install it separately.

The version number of OpenFst-Python is the same as the OpenFst version used. The current version uses OpenFst 1.7.9.

Build Requirements

The build process will download and build OpenFst from the official webpage, so you need an Internet connection and all OpenFst dependencies. Essentially, you will need:

Installation

Most likely, you want to avoid the build process. Then, simply install the package from PyPI:

pip install openfst-python

Alternatively, if you are installing from sources, you can simply do:

python setup.py install

Notice that this downloads the appropriate version of OpenFst directly from the Internet. If you don't have an Internet connection but are already in possession of the appropriate tar.gz file, you can use the following command:

python setup.py build --download-dir=DIRECTORY_CONTAINING_OPENFST_TAR_GZ
python setup.py install

Documentation

The Python API is the official one provided by OpenFst. Please, refer to its documentation.

A toy example:

import openfst_python as fst

f = fst.Fst()
s0 = f.add_state()
s1 = f.add_state()
s2 = f.add_state()
f.add_arc(s0, fst.Arc(1, 2, fst.Weight(f.weight_type(), 3.0), s1))
f.add_arc(s0, fst.Arc(1, 3, fst.Weight.One(f.weight_type()), s2))
f.add_arc(s1, fst.Arc(2, 1, fst.Weight(f.weight_type(), 1.0), s2))
f.set_start(s0)
f.set_final(s2, fst.Weight(f.weight_type(), 1.5))

License

The OpenFst library is licensed under the Apache License, Version 2.0. OpenFst-Python is just a wrapper of its official Python API, so I am using the same license for most of the source code. ac_python_devel.m4 was not written by me and it is licensed under the GPL license.

openfst-python's People

Contributors

jpuigcerver avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.