A simple text search implementation in python