in reply to searching for a keyword with context window

I'd hate to code the search algorithm myself efficiently, so I might shell out to grep -A 1 -B 1 keyword filename, join the lines together, and do the five word windowing on the results.