Skip to main content

Python implementation of the Pass-join index

Project description

Passjoin

Python implementation of the Pass-join index.

This index allows to efficiently query similar words within a distance threshold.

The implementation is based on this paper and the existing Javascript implementation in the mnemoist package (link).

Installation

Usage

Index creation

from passjoin import Passjoin
from Levenshtein import distance  # or any string distance function

max_edit_distance = 1  # maximum edit distance for retrieval
corpus = ['pierre', 'pierr', 'jean', 'jeanne']

passjoin_index = Passjoin(corpus, max_edit_distance, distance)

Index querying

passjoin_index.get_word_variations('pierre')
>> {'pierre', 'pierr'}

passjoin_index.get_word_variations('jeann')
>> {'jean', 'jeanne'}

passjoin_index.get_word_variations('jeanine')
>> {'jeanne'}

Contributing

Clone the project.

Install pipenv.

Run pipenv install --dev

Launch test with pipenv run pytest

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

passjoin-0.0.1.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

passjoin-0.0.1-py2.py3-none-any.whl (3.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file passjoin-0.0.1.tar.gz.

File metadata

  • Download URL: passjoin-0.0.1.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.3

File hashes

Hashes for passjoin-0.0.1.tar.gz
Algorithm Hash digest
SHA256 1574bec22c46e1c72711f8d5b1abcf992fd04cc66b329dc7b2726ae77016a25b
MD5 7a58d41aed5434f99223e4f198b1fb2f
BLAKE2b-256 67585be7a34163d4650f66df701f93d450d16f13d2ea901948047225f287a78a

See more details on using hashes here.

File details

Details for the file passjoin-0.0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: passjoin-0.0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.3

File hashes

Hashes for passjoin-0.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f59a009f9aa665eb52f9dd56e36420a0c7c4f2e74f35bf20819677ee4e838c5f
MD5 78269923df40a6c8911b453d877cf0d3
BLAKE2b-256 c8a5bf00ecaad1310fcd4d8ca1754e9aefcba1e83c01d45aa70a4eefe69901f1

See more details on using hashes here.

Supported by

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