LindseyB/starwars-dot-gif — pull request #7 by desyncr (2013-10-04 04:51:18+00:00)
Title: Changed search function to be more flexible.

Now it allows to search for words in no particular order. But all words
must be present. A future improvement would be to allow a rank of result based off of how many words matched against each item, being ranked higher the ones with the larger number of matches (ie: more relevant)

Here is an example of the new search function: http://asciinema.org/a/5718

I tried to leave it in one line but python is not my friend.

matching = [s for s in subs if reduce(lambda a, b: a in s.text.lower() and b in s.text.lower(), search)]

Also, the fuzzy algo I mentioned earlier is too fuzzy and match almost anything so it's not really useful here.

I don't often work with python so let me know if I miss something or there is something wrong with the code.