#NEWLINE# def apply( self , chart , grammar , edge1 ) : #NEWLINE# #INDENT# fr = self . _fundamental_rule #NEWLINE# if edge1 . is_incomplete ( ) : #NEWLINE# #INDENT# for edge2 in chart . select ( start = edge1 . end ( ) , is_complete = True , lhs = edge1 . nextsym ( ) ) : #NEWLINE# #INDENT# for new_edge in fr . apply ( fr , grammar , edge1 , edge2 ) : #NEWLINE# #INDENT# ( yield new_edge ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# for edge2 in chart . select ( end = edge1 . start ( ) , is_complete = False , nextsym = edge1 . lhs ( ) ) : #NEWLINE# #INDENT# for new_edge in fr . apply ( chart , grammar , edge2 , edge1 ) : #NEWLINE# #INDENT# ( yield new_edge )