def pretty_format_edge(self, edge, width=None):
        if width is None: width = 50 // (self.num_leaves()+1)
        (start, end) = (edge.start(), edge.end())

        str = '|' + ('.'+' '*(width-1))*start

        # Zero-width edges are "#" if complete, ">" if incomplete
        if start == end:
            if edge.is_complete(): str += '#'
            else: str += '>'

        # Spanning complete edges are "[===]"; Other edges are
        # "[---]" if complete, "[--->" if incomplete
        elif edge.is_complete() and edge.span() == (0,self._num_leaves):
            str += '['+('='*width)*(end-start-1) + '='*(width-1)+']'
        elif edge.is_complete():
            str += '['+('-'*width)*(end-start-1) + '-'*(width-1)+']'
        else:
            str += '['+('-'*width)*(end-start-1) + '-'*(width-1)+'>'

        str += (' '*(width-1)+'.')*(self._num_leaves-end)
        return str + '| %s' % edge
Return a pretty-printed string representation of a given edge
dataset/ETHPy150Open nltk/nltk/nltk/parse/chart.py/Chart.pretty_format_edge