code: def phrase_replace(self, replace_dict):
  
          
  
          def r(tokens):
                  text = ' ' + ' '.join(tokens)
                  for k, v in replace_dict.items():                    
                      text = text.replace(" " + k + " ", " " + v + " ")
                  return text.split()
          self.stems = list(map(r, self.stems))
docs: Replace phrases with single token, mapping defined in replace_dict