code: def parse_substitutions(self, messages):
          
          # If no substitutions have been defined, just normalize the message
          if not self._substitutions:
              self._log.info('No substitutions to process')
              return messages
  
          self._log.info('Processing message substitutions')
  
          def substitute(sub_group, sub_message):
              word, substitution = sub_group
              return word.sub(substitution, sub_message)
  
          normalized, preserve_case, raw = messages
          for sub_normalized, sub_preserve_case, sub_raw in self._substitutions:
              normalized = substitute(sub_normalized, normalized)
              preserve_case = substitute(sub_preserve_case, preserve_case)
              raw = substitute(sub_raw, raw)
  
          return normalized, preserve_case, raw
docs: Parse substitutions in a supplied message
          :param messages: A tuple messages being parsed (normalized, case preserved, raw)
          :type  messages: tuple of (str, str, str)
  
          :return: Substituted messages (normalized, case preserved, raw)
          :rtype : tuple of (str, str, str)