python truncate text around keyword
<p>I have a string and I want to search it for a keyword or phrase and return only a portion of the text before and after the keyword or phrase.  Google does exactly what I am talking about.</p>

<p>Here is a string I grabbed from the web:</p>

<p><em>"This filter truncates words like the original truncate words Django filter, but instead of being based on the number of words, it's based on the number of characters. I found the need for this when building a website where i'd have to show labels on really small text boxes and truncating by words didn't always gave me the best results (and truncating by character is...well...not that elegant)."</em></p>

<p>Now lets say I want to search this for the phrase <code>building a website</code> and then output something like this:</p>

<p>"<em>... the need for this when <strong>building a website</strong> where i'd have to show ...</em>"</p>

<p><strong>Edit:</strong> I should have made this more clear.  This has to work on multiple strings / phrases, not just this one. </p>
