def parse_statement(self, statement, context):
    if ((statement[0], len(statement)) in self.failed_parses):
        return (False, False)
    tuples = self.search.find_longest(statement)
    if tuples:
        return tuples
    if (statement[1] in self.variables):
        for f in context.f.values():
            if ((f.variable == statement[1]) and (f.vclass == statement[0])):
                return (statement[:2], f.tree)
    for prop_label in self.propositions:
        prop = self.propositions[prop_label]
        (string, tree) = self.proposition_describes_statement(prop, statement, context)
        if (string == False):
            continue
        self.search.add(string, (string, tree))
        return (string, tree)
    self.failed_parses.add((statement[0], len(statement)))
    return (False, False)
def parse_statement(self, statement, context):
    if ((statement[0], len(statement)) in self.failed_parses):
        return (False, False)
    tuples = self.search.find_longest(statement)
    if tuples:
        return tuples
    if (statement[1] in self.variables):
        for f in context.f.values():
            if ((f.variable == statement[1]) and (f.vclass == statement[0])):
                return (statement[:2], f.tree)
    for prop_label in self.propositions:
        prop = self.propositions[prop_label]
        (string, tree) = self.proposition_describes_statement(prop, statement, context)
        if (string == False):
            continue
        self.search.add(string, (string, tree))
        return (string, tree)
    self.failed_parses.add((statement[0], len(statement)))
    return (False, False)