Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'example:': 0.03; 'subject:not': 0.03; 'base.': 0.05; 'coverage.': 0.07; 'indicating': 0.07; 'suggestions,': 0.07; '[1]:': 0.09; 'url:github': 0.09; 'python': 0.11; 'insertions': 0.16; 'usual:': 0.16; 'extensions': 0.16; 'library': 0.18; 'everyone,': 0.19; '>>>': 0.22; 'import': 0.22; 'install': 0.23; "i've": 0.25; 'defined': 0.27; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; "skip:' 10": 0.31; 'url:wiki': 0.31; 'comments,': 0.31; 'extensively': 0.31; 'subject:what': 0.31; 'url:wikipedia': 0.31; 'bugs': 0.33; 'implemented': 0.33; "i'd": 0.34; 'basic': 0.35; 'received:209.85': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'useful': 0.36; 'url:org': 0.36; 'should': 0.36; 'searching': 0.37; 'received:209': 0.37; 'feedback': 0.38; 'skip:[ 10': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'algorithms': 0.60; 'further': 0.61; 'maximum': 0.63; 'more': 0.64; 'love': 0.65; 'here': 0.66; 'introduce': 0.78; '97%': 0.84; 'subject:find': 0.84; 'subject:you': 0.87; 'subject:looking': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=PXIJGa+QLKUyFnlzx6Q/RZly2gBFARcTetWFUk2Vq9g=; b=Rlq2xUVQwc6cwdKuqaEAYGg4TTsb9JTjlb1q76+dcxa4V/wy3iidMDK/L8wZdawPni oSm+Iof8mk4aBpJfx8MkXlIKkYkrDKGs9ZuLyplC73vLUwavmd+RYjsiP+WObli9jKD9 7UFxKZyuhg/OhhRjMr+o4LKj7TeRTbIzqiokbnYEMnad4PWRCpLTYg2RWnGz9h7bZeZY M8SkryWb5GQE19hMxfOuLRqbMK14/LdAnj/0SLxYGm8v92Doi7/dVMijzOBFK0qiv3rt JqqdG3tkzEhnV1FuNxjgFtqSnHhl1+a3yZWWgzIvqfcMRmxjfU871IDDhj75uxkmpl21 AEpA== X-Received: by 10.70.42.102 with SMTP id n6mr8951677pdl.85.1423770697834; Thu, 12 Feb 2015 11:51:37 -0800 (PST) MIME-Version: 1.0 From: Tal Einat Date: Thu, 12 Feb 2015 21:51:17 +0200 Subject: fuzzysearch: find not exactly what you're looking for! To: python-list@python.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 34 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1423770701 news.xs4all.nl 2838 [2001:888:2000:d::a6]:60608 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:85612 Hi everyone, I'd like to introduce a Python library I've been working on for a while: fuzzysearch. I would love to get as much feedback as possible: comments, suggestions, bugs and more are all very welcome! fuzzysearch is useful for searching when you'd like to find nearly-exact matches. What should be considered a "nearly matching" sub-string is defined by a maximum allowed Levenshtein distance[1]. This can be further refined by indicating the maximum allowed number of substitutions, insertions and/or deletions, each separately. Here is a basic example: >>> from fuzzysearch import find_near_matches >>> find_near_matches('PATTERN', 'aaaPATERNaaa', max_l_dist=1) [Match(start=3, end=9, dist=1)] The library supports Python 2.6+ and 3.2+ with a single code base. It is extensively tested with 97% code coverage. There are many optimizations under the hood, including custom algorithms and C extensions implemented in C and Cython. Install as usual: $ pip install fuzzysearch The repo is on github: https://github.com/taleinat/fuzzysearch Let me know what you think! - Tal Einat .. [1]: http://en.wikipedia.org/wiki/Levenshtein_distance