basho / cuttlefish

never lose your childlike sense of wonder baby cuttlefish, promise me?
Apache License 2.0
205 stars 124 forks source link

A more tolerant cuttlefish_variable:fuzzy_matches? #99

Open joedevivo opened 10 years ago

joedevivo commented 10 years ago
2> Conf = [{["a", "b", "c"], 1},{["a", "b", "d"], 2},{["a", "c", "c"], 3}].
[{["a","b","c"],1},{["a","b","d"],2},{["a","c","c"],3}]
3> cuttlefish_variable:fuzzy_matches("a.$name.c", Conf).
[]
4> cuttlefish_variable:fuzzy_matches(["a", "$name", "c"], Conf).
[{"$name","c"},{"$name","b"}]
5> cuttlefish_variable:fuzzy_matches(["a", "$name"], Conf).     
[]
6> cuttlefish_variable:fuzzy_matches(["a", "$name", "d"], Conf).
[{"$name","b"}]

a) we should see "a.$name.c" and tokenize it if it's a string b) we should allow a search for "a.$name" to find everything that could start with "a.$name"