...using the Smith Waterman algorithm for finding local string matches. Source code here (GPLv3).
Threshold score:
Score function:
indel: -2, match: 1, mismatch: -1. Better at example 1
indel (e,o): -1, match: 1, mismatch (e/a, g/j, v/w): 0, mismatch or indel (rest of the letters): -1000. Better at example 2
it's complicated (see source code. todo cleanup)