#NEWLINE# def _trace_production( self , production , p , span , width ) : #NEWLINE# #INDENT# '\n        Print trace output indicating that a given production has been\n        applied at a given location.\n\n        :param production: The production that has been applied\n        :type production: Production\n        :param p: The probability of the tree produced by the production.\n        :type p: float\n        :param span: The span of the production\n        :type span: tuple\n        :rtype: None\n        ' #NEWLINE# str = ( '|' + ( '.' * span [ 0 ] ) ) #NEWLINE# str += ( '=' * ( span [ 1 ] - span [ 0 ] ) ) #NEWLINE# str += ( ( '.' * ( width - span [ 1 ] ) ) + '| ' ) #NEWLINE# str += ( '%s' % production ) #NEWLINE# if ( self . _trace > 2 ) : #NEWLINE# #INDENT# str = ( '%-40s %12.10f ' % ( str , p ) ) #NEWLINE# #UNINDENT# print ( str )