#NEWLINE# def apply( self , chart , grammar , left_edge , right_edge ) : #NEWLINE# #INDENT# if ( not ( ( left_edge . end ( ) == right_edge . start ( ) ) and ( left_edge . nextsym ( ) == right_edge . lhs ( ) ) and left_edge . is_incomplete ( ) and right_edge . is_complete ( ) ) ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# p = ( left_edge . prob ( ) * right_edge . prob ( ) ) #NEWLINE# new_edge = ProbabilisticTreeEdge ( p , span = ( left_edge . start ( ) , right_edge . end ( ) ) , lhs = left_edge . lhs ( ) , rhs = left_edge . rhs ( ) , dot = ( left_edge . dot ( ) + 1 ) ) #NEWLINE# changed_chart = False #NEWLINE# for cpl1 in chart . child_pointer_lists ( left_edge ) : #NEWLINE# #INDENT# if chart . insert ( new_edge , ( cpl1 + ( right_edge , ) ) ) : #NEWLINE# #INDENT# changed_chart = True #NEWLINE# #UNINDENT# #UNINDENT# if changed_chart : #NEWLINE# #INDENT# ( yield new_edge )