def _check_and_parse_if_line_is_a_label(self, line: str) -> bool: current_line_is_label = False for label, label_pattern in self.label_patterns: # type: Tuple[Term, Pattern[str]] matches_label = label_pattern.search(line) if matches_label is not None: parsed_label = Term.from_string(line) self.labels_of_current_example[parsed_label] = get_probability(parsed_label) current_line_is_label = True return current_line_is_label
def test(): test = 'begin(model(2)).' test_term = Term.from_string(test) print(test_term)