def _convert_to_spans(self, tree, start, set, parent = None): 
        if len(tree) == 3:
            # Binary rule.
            # Remove unary collapsing.
            current = self._remove_vertical_markovization(tree[0]).split("+")
            split = self._convert_to_spans(tree[1], start, set, None)
            end = self._convert_to_spans(tree[2], split + 1, set, current[-1])
            
            # Add phrases to set
            if current[0] != parent: 
                set.add((current[0], start, end))
            for nt in current[1:]:
                set.add((nt, start, end))
            return end
        
        elif len(tree) == 2:
            # Unary rule.
            
            # Can have a constituent if it is collapsed.
            current = self._remove_vertical_markovization(tree[0]).split("+")
            for nt in current[:-1]:
                set.add((nt, start, start))
            return start
Show the log
dataset/ETHPy150Open emilmont/pyStatParser/stat_parser/eval_parser.py/TreeOperations._convert_to_spans--crossover with--dataset/ETHPy150Open glue-viz/glue/glue/app/qt/application.py/GlueLogger._show