This release is a pre-release and may not be stable for production use.
FST Lookup
Implements lookup for FOMA format finite state transducers.
Supports Python 3.5 and up.
Usage
Import the library, and load an FST from a file:
>>> from fst_lookup import FST
>>> fst = FST.from_file('eat.fomabin')
Analysis
To analyze a form (take a word form, and get its linguistic analyzes)
call the analyze() function:
def analyze(self, surface_form: str) -> Iterator[Analysis]
This will yield all possible linguistic analyses produced by the FST.
An analysis is a tuple of strings. The strings are either linguistic tags, or the lemma (base form of the word).
FST.analyze() is a generator, so you must call list() to get a list.
>>> list(sorted(fst.analyze('eats')))
[('eat', '+N', '+Mass'),
('eat', '+V', '+3P', '+Sg')]
Generate
To generate a form (take a linguistic analysis, and get its concrete
word forms), call the generate() function:
def generate(self, analysis: str) -> Iterator[str]
FST.generate() is a Python generator, so you must call list() to get
a list.
>>> list(fst.generate('eat+V+Past')))
['ate']
License
Copyright © 2019 Eddie Antonio Santos. Released under the terms of the
Apache license. See LICENSE for more info.
Release files for fst-lookup 2019.1.30a0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fst-lookup-2019.1.30a0.tar.gz | 11.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fst_lookup-2019.1.30a0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.2 kB
Release files / fst-lookup-2019.1.30a0.tar.gz
| Download URL | fst-lookup-2019.1.30a0.tar.gz |
|---|---|
| Size | 11.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
568de67662f4b55fd7529cb80729d2efb8343bfc274e54fab215876c537af592
|
|
BLAKE2b-256 checksum How to use checksums |
c62ba8792e0ea8d4dfd6f1d9bfd694bb7660ceb8eb31a1c918e7bf6cd29bf692
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.5.2
|
Release files / fst_lookup-2019.1.30a0-py3-none-any.whl
| Download URL | fst_lookup-2019.1.30a0-py3-none-any.whl |
|---|---|
| Size | 16.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
069f74e558b01c942a17e510fe2d910c99e6687d1e8076afd73ae4f7a05e5c7e
|
|
BLAKE2b-256 checksum How to use checksums |
64e96a0c3434a522a6cf7f3adfebbbee66e4133f02faf5c5cfbe358784767d95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.5.2
|