fuzzymap compare lowercase
This commit is contained in:
@@ -28,7 +28,7 @@ abstract FuzzyMap<T>(StringMap<T>) from StringMap<T> to StringMap<T> {
|
|||||||
var bestKey = null;
|
var bestKey = null;
|
||||||
|
|
||||||
for (key in this.keys()) {
|
for (key in this.keys()) {
|
||||||
var score = 1 - (key.getLevenshteinDistance(fuzzySearchKey) / Math.max(key.length, fuzzySearchKey.length));
|
var score = 1 - (key.toLowerCase().getLevenshteinDistance(fuzzySearchKey.toLowerCase()) / Math.max(key.length, fuzzySearchKey.length));
|
||||||
if (score > bestScore) {
|
if (score > bestScore) {
|
||||||
bestScore = score;
|
bestScore = score;
|
||||||
bestKey = key;
|
bestKey = key;
|
||||||
|
|||||||
Reference in New Issue
Block a user