title: Highlight verb phrases using spacy and html
body: <p>I have devised a code to red font verb phrases and output it as HTML.</p>
  
  <pre><code>from __future__ import unicode_literals
  import spacy,en_core_web_sm
  import textacy
  import codecs
  nlp = en_core_web_sm.load()
  sentence = 'The author is writing a new book. The dog is barking.'
  pattern = r'&lt;VERB&gt;?&lt;ADV&gt;*&lt;VERB&gt;+'
  doc = textacy.Doc(sentence, lang='en_core_web_sm')
  lists = textacy.extract.pos_regex_matches(doc, pattern)
  with open("my.html","w") as fp:
      for list in lists:
          search_word = (list.text)
          fp.write(sentence.replace(search_word, '&lt;span style="color: red"&gt;{}&lt;/span&gt;'.format(search_word)))
  </code></pre>
  
  <p>Current output</p>
  
  <pre><code>The author **is writing** a new book. The dog is barking.The author is writing a new book. The dog **is barking.**
  </code></pre>
  
  <p>The sentence is getting repeated twice and first is writing and last is barking is detected.</p>
  
  <p>Expected output:</p>
  
  <pre><code>The author **is writing** a new book. The dog **is barking.**
  </code></pre>
  
  <p>Should i have to do a sentence tokenization before sending it to list check? Please help?</p>