Skip to main content

Search over large sets of strings

Project description

Python bindings to crate FST

For more mature implementation see https://github.com/jbaiter/python-rust-fst

Motivation

This package is quick workaround for https://github.com/BurntSushi/fst/issues/38

In its state as is, it should not be really used, but I would not mind adding missing API, if you fill an issue.

Issue is fixed by throwing faulty levenstein DFA out the window, so performance will suffer. I will try to find time fix actual issue downstream later.

Installation

TODO

Usage

from fst_python_bindings import FstMap

items = [
    ('soy', 0),
    ('joy', 2),
    ('godefroy', 3),
    ('godfrey', 3)
]
# Items must be in lexicographical order
items.sort(key=lambda item: item[0])

# Create map instance.
fst_map = FstMap.from_iter()

print(fst_map.search_levenstein('roy', 1))
print(fst_map.search_levenstein('godefrey', 1))

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

fst_python_bindings-0.2.0.tar.gz (3.8 kB view hashes)

Uploaded Source

Built Distributions

fst_python_bindings-0.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.8 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

fst_python_bindings-0.2.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.8 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARM64

fst_python_bindings-0.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.8 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

fst_python_bindings-0.2.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.8 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

fst_python_bindings-0.2.0-cp311-cp311-macosx_11_0_arm64.whl (219.7 kB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

fst_python_bindings-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.8 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

fst_python_bindings-0.2.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.8 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

fst_python_bindings-0.2.0-cp310-cp310-macosx_11_0_arm64.whl (219.7 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

fst_python_bindings-0.2.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.2 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARM64

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