#NEWLINE# def fuzzyEquals( addr , labels_pred , labels_true ) : #NEWLINE# #INDENT# labels = [ ] #NEWLINE# fuzzy_labels = [ ] #NEWLINE# for label in labels_pred : #NEWLINE# #INDENT# if label . startswith ( 'StreetName' ) : #NEWLINE# #INDENT# fuzzy_labels . append ( 'StreetName' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if label . startswith ( 'AddressNumber' ) : #NEWLINE# #INDENT# fuzzy_labels . append ( 'AddressNumber' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( label == 'Null' ) : #NEWLINE# #INDENT# fuzzy_labels . append ( 'NotAddress' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# fuzzy_labels . append ( label ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# for label in labels_true : #NEWLINE# #INDENT# labels . append ( label ) #NEWLINE# #UNINDENT# prettyPrint ( addr , fuzzy_labels , addr ) #NEWLINE# assert ( fuzzy_labels == labels )