fuzzymatch

emlib.textlib.fuzzymatch(pattern, strings)[source]

Find possible matches to pattern in strings.

This implements a very simple algorithm. Returns a subseq. of strings sorted by best score. Only strings representing possible matches are returned

Parameters:
  • pattern (str) – the string to search for within strings

  • strings (list[str]) – a list os possible strings

Return type:

list[tuple[float, str]]

Returns:

a list of (score, string match)