Implementations of a sanitize function¶
I was thinking about different ways to implement a function like sanitize(unsanitized_input, ignored_words) in Python.
I came up with a few implementations and noted the downsides of each, etc. Just a little snippet that others might benefit from.
Go comment on it with your own implementation if I missed some good ideas.
https://gist.github.com/durden/4504120
I also included some code to check the performance of the functions. Obviously, they all perform fairly close to each other, but just something interesting to think about in your free time: