code: def lemmatize(self, input_text, return_raw=False, return_string=False):
          
          assert type(input_text) in [list, str], \
              logger.error('Input must be a list or string.')
          if type(input_text) is str:
              punkt = PunktLanguageVars()
              tokens = punkt.word_tokenize(input_text)
          else:
              tokens = input_text
  
          lemmatized_tokens = []
          for token in tokens:
              # check for final period
              final_period = False
              if token[-1] == '.':
                  final_period = True
                  token = token[:-1]
  
              # look for token in lemma dict keys
              if token.lower() in self.lemmata.keys():
                  headword = self.lemmata[token.lower()]
  
                  # re-add final period if rm'd
                  if final_period:
                      headword += '.'
  
                  # append to return list
                  if not return_raw:
                      lemmatized_tokens.append(headword)
                  else:
                      lemmatized_tokens.append(token + '/' + headword)
              # if token not found in lemma-headword list
              else:
                  # re-add final period if rm'd
                  if final_period:
                      token += '.'
  
                  if not return_raw:
                      lemmatized_tokens.append(token)
                  else:
                      lemmatized_tokens.append(token + '/' + token)
          if not return_string:
              return lemmatized_tokens
          elif return_string:
              return ' '.join(lemmatized_tokens)
docs: Take incoming string or list of tokens. Lookup done against a
          key-value list of lemmata-headword. If a string, tokenize with
          ``PunktLanguageVars()``. If a final period appears on a token, remove
          it, then re-add once replacement done.
          TODO: rm check for final period, change PunktLanguageVars() to nltk_tokenize_words()