Locate the best instance of 'pattern' in 'text' near 'loc' using the Bitap algorithm. Returns -1 if no match found. @param text The text to search. @param pattern The pattern to search for. @param loc The location to search around. @return Best match index or -1.
Compute and return the score for a match with e errors and x location. @param e Number of errors in match. @param x Location of match. @param loc Expected location of match. @param pattern Pattern being sought. @return Overall score for match (0.0 = good, 1.0 = bad).
Initialise the alphabet for the Bitap algorithm. @param pattern The text to encode. @return Hash of character locations.
Locate the best instance of 'pattern' in 'text' near 'loc'. Returns -1 if no match found. @param text The text to search. @param pattern The pattern to search for. @param loc The location to search around. @return Best match index or -1.