3 ms·
I've always found searching by space-separated substrings, matched in any order, to work vastly better for matching identifiers or file names. No confusion abou
by to3m 11y ago
I've always found searching by space-separated substrings, matched in any order, to work vastly better for matching identifiers or file names. No confusion about how best to match a particular sequence of letters: either that sequence is an exact substring, and the string matches, or it isn't, and it doesn't. (If you want multiple substrings, separate the substrings with spaces.)
This is simplicity itself to code up. Here's quick and dirty python one, for example, that would get you started. It's so simple that I'm pretty sure it works, even though I haven't tested it.
def get_suggestions(xs,str):
"""return list of elements in XS that match STR, the match string"""
suggestions=xs[:]
for part in str.split(): suggestions=[x for x in suggestions if part in x]
return suggestions
This is also (or so I think) better to use. As a user you get a lot more control over what you're finding, and you don't have to think very hard about what chars to add in to eliminate items you don't want. So it's very likely you'll be able to quickly winnow your list down to 1 item.
And because it doesn't have any complicated workings inside it, it can be explained even to non-technical users, who can make good use of it.