fuzzyCompare

fun String.fuzzyCompare(haystackString: String, needleCanBeShorter: Boolean): Double

fuzzyCompare is based on Damerau-Levenshtein distance. It return a score which is the ratio of the distance to the length of the strings. However, it also allows for the search string to be shorter than the haystack string and will give a slightly better score to strings that are naturally the same length.