Exemplo n.º 1
0
    def __init__(self, size):
        # length of the console
        self._size = 20

        # stores our Message objects in a list
        self._log = []
        # initialize our log to the empty string for each entry
        for i in range(0, self._size):
            self._log.append(Message(["?" * 40]))

        # parsing for commands
        self.parser = Parser(self)
Exemplo n.º 2
0
 def train_test(passages, *args, **kwargs):
     p = Parser(*args, **kwargs)
     p.train(passages)
     _, parsed = zip(*p.parse(passages))
     return parsed