Find parts of long text or data, allowing for some changes/typos.
Go to file
Tal Einat b79a856b63 split into several files and renamed some functions 2014-03-12 12:00:21 +02:00
benchmarks split into several files and renamed some functions 2014-03-12 12:00:21 +02:00
docs initial commit (project framework) 2013-11-02 00:34:18 +02:00
fuzzysearch split into several files and renamed some functions 2014-03-12 12:00:21 +02:00
tests split into several files and renamed some functions 2014-03-12 12:00:21 +02:00
.gitignore initial commit (project framework) 2013-11-02 00:34:18 +02:00
.travis.yml py31 not supported by Travis, so removed it from .travis.yml 2013-11-12 16:12:54 +02:00
AUTHORS.rst initial commit (project framework) 2013-11-02 00:34:18 +02:00
CONTRIBUTING.rst initial commit (project framework) 2013-11-02 00:34:18 +02:00
HISTORY.rst fixed wrong date used in HISTORY 2013-11-12 16:22:27 +02:00
LICENSE Initial commit 2013-11-01 15:12:11 -07:00
MANIFEST.in initial commit (project framework) 2013-11-02 00:34:18 +02:00
Makefile initial commit (project framework) 2013-11-02 00:34:18 +02:00
README.rst bumped version and updated docs 2013-11-12 10:58:41 +02:00
requirements.txt initial commit (project framework) 2013-11-02 00:34:18 +02:00
setup.py bumped version and updated docs 2013-11-12 10:58:41 +02:00
test_requirements.txt initial commit (project framework) 2013-11-02 00:34:18 +02:00
tox.ini initial commit (project framework) 2013-11-02 00:34:18 +02:00

README.rst

===============================
fuzzysearch
===============================

.. image:: https://badge.fury.io/py/fuzzysearch.png
    :target: http://badge.fury.io/py/fuzzysearch
    
.. image:: https://travis-ci.org/taleinat/fuzzysearch.png?branch=master
        :target: https://travis-ci.org/taleinat/fuzzysearch

.. image:: https://pypip.in/d/fuzzysearch/badge.png
        :target: https://crate.io/packages/fuzzysearch?version=latest


fuzzysearch is useful for finding approximate subsequence matches

* Free software: MIT license
* Documentation: http://fuzzysearch.rtfd.org.

Features
--------

* Fuzzy sub-sequence search: Find parts of a sequence which match a given sub-sequence up to a given maximum Levenshtein distance.

Example
-------
.. code:: python

    >>> sequence = '''\
    GACTAGCACTGTAGGGATAACAATTTCACACAGGTGGACAATTACATTGAAAATCACAGATTGGTCACACACACA
    TTGGACATACATAGAAACACACACACATACATTAGATACGAACATAGAAACACACATTAGACGCGTACATAGACA
    CAAACACATTGACAGGCAGTTCAGATGATGACGCCCGACTGATACTCGCGTAGTCGTGGGAGGCAAGGCACACAG
    GGGATAGG'''
    >>> subsequence = 'TGCACTGTAGGGATAACAAT' #distance 1
    >>> max_distance = 2

    >>> from fuzzysearch import find_near_matches_with_ngrams
    >>> find_near_matches_with_ngrams(subsequence, sequence, max_distance)
    [Match(start=3, end=24, dist=1)]