Closed sadovnychyi closed 8 years ago
fuzz = require("fuzzaldrin-plus");
fuzz.filter(["bla", "_test", "test"], "_t");
This will return the two last result (thus _ can be there or no), better score if it is. There is a spec that say if no input return no result with a short circuit.
Would you want that a string made only of optional characters return all results ?
I would like to return all results with that optional character/s presented. In this case only "_test".
Or, at least there's should be a way to change regex for optional characters. Can I monkey patch it from outside somehow? Since in python "_" is pretty important part of names.
Optional character regex is applied once at the construction of query so I can definitively make it part of the option hash
Version 0.3.1 now have the behavior you want. Other candidates are not explicitly filtered out, but since nothing match, they still have score of 0.
Version 0.4 will have the ability to set optional character regex. I'll also add a flag that set whether the filtering should be done assuming result are path. (Right now it's always making that assumption and surprisingly it works)
Thanks, it's fixed issue for me!
I expected to see "_test" in results, but got nothing instead. It works in fuzzaldrin. Anything I'm missing about how to configure optional characters?
sadovnychyi/autocomplete-python#130