title: Labelling sentences based on specific punctuations
body: <p>I have list of sentences in which words need to be labelled based on particular punctuation. If one of the punctuation characters comes after a word in a sentence it should put a label as a name of punctuation character. Sentences are already splitted into words and stored in a list.</p>
  <pre><code>sentence = ['I', 'like', 'to', 'read', 'a', 'book,', 'dont', 'you?']
  targets = {',': 'COMMA', '.': 'PERIOD', '?': 'QUESTION'}
  no_punctuation = &quot;EMPTY&quot;
  
  
  for word in sentence:
      for key, value in targets.items():
          if word.endswith(key):
              word = word.rstrip(key)
              print(&quot;{}\t{}&quot;.format(word, value))
          else:
              print(&quot;{}\t{}&quot;.format(word, no_punctuation))
  </code></pre>
  <p>Seems there are many irrelevant copies printed to the output which is not desired</p>
  <pre><code>I EMPTY
  I EMPTY
  I EMPTY
  like EMPTY
  like EMPTY
  like EMPTY
  to EMPTY
  to EMPTY
  to EMPTY
  read EMPTY
  read EMPTY
  read EMPTY
  a EMPTY
  a EMPTY
  a EMPTY
  book COMMA
  book EMPTY
  book EMPTY
  dont EMPTY
  dont EMPTY
  dont EMPTY
  you? EMPTY
  you? EMPTY
  you QUESTION
  </code></pre>
  <p>Expected output:</p>
  <pre><code>I EMPTY
  like EMPTY
  to EMPTY
  read EMPTY
  a EMPTY
  book COMMA
  dont EMPTY
  you QUESTION
  </code></pre>