Does anyone know if there is a good way to create a map from string to string that has approximate string keys? That is, if I do the following:
map.put("Fuzzy", "string")
map.put("Fuzy", "bear")
I want the resulting map to be:
[ "Fuzzy":{ "string", "bear" } ]
(There might also be something in there to note that "bear" came from "Fuzy", but that is a secondary concern). Of course, the amount of approximation (distance) between strings would probably be a parameter. In this case, the distance is 1, but it could be more or less.
As far as I can tell, a Trie might be a good place to start, but I didn't want to implement something and find it has already been done.
Of course, the naive solution is just to loop over all the keys in the map, but I'm hoping for better efficiency than that.
Thanks!