code: def gen_sentences(self, tokens, aliases=None):
          
          if aliases is None:
              aliases = {}
          for sentence in self._gen_sentences(tokens):
              try:
                  alias = aliases[str(sentence[0])]
              except KeyError:
                  # do nothing if no alias is found
                  pass
              except IndexError:
                  pass
              else:
                  sentence[0:1] = list(Program(alias).gen_tokens())
              yield transform(Sentence(sentence), self.transforms)
docs: Generate a sequence of sentences from stream of tokens.