title: Extract n Words Around Defined Term (Multicase)
body: <p>I have a <strong>vector of text string</strong>s, such as:</p>
  
  <pre><code>Sentences &lt;- c("I would have gotten the promotion, but TEST my attendance wasn’t good enough.Let me help you with your baggage.",
                 "Everyone was busy, so I went to the movie alone. Two seats were vacant.",
                 "TEST Rock music approaches at high velocity.",
                 "I am happy to take your TEST donation; any amount will be greatly TEST appreciated.",
                 "A purple pig and a green donkey TEST flew a TEST kite in the middle of the night and ended up sunburnt.",
                 "Rock music approaches at high velocity TEST.")
  </code></pre>
  
  <p>I would like to <strong>extract n</strong> (for example: three) <strong>words</strong> (a word is characterized by a whitespace before and after character(s)) <strong>AROUND (i.e., before and after) a particular term</strong> (e.g., 'TEST').
  Improtant: <strong>Several</strong> <strong>matches</strong> should be <strong>allowed</strong> (i.e., if a particular term occurs more than one times, the intended solution should capture those cases).</p>
  
  <p>The result might look like this (the format can be improved):</p>
  
  <pre><code>S1  &lt;- c(before = "the promotion, but", after = "my attendance wasn’t")
  S2  &lt;- c(before = "",                   after = "")
  S3  &lt;- c(before = "",                   after = "Rock music approaches")
  S4a &lt;- c(before = "to take your",       after = "donation; any amount")
  S4b &lt;- c(before = "will be greatly",    after = "appreciated.")
  S5a &lt;- c(before = "a green donkey",     after = "flew a TEST")
  S5b &lt;- c(before = "TEST flew",          after = "kite in the")
  S6  &lt;- c(before = "at high velocit",    after = "")  
  </code></pre>
  
  <p>How can I do this? I already figured out other psots, which are either o<a href="https://stackoverflow.com/questions/34403346/extract-a-sample-of-words-around-a-particular-word-using-stringr-in-r">nly for one-case-matches</a> or relate to <a href="https://stackoverflow.com/questions/33856148/regex-in-r-extracting-words-from-a-string">fixed sentence structures</a>.</p>