#NEWLINE# def twoGramFingerprint( field ) : #NEWLINE# #INDENT# if ( len ( field ) > 1 ) : #NEWLINE# #INDENT# return ( '' . join ( sorted ( ( gram . strip ( ) for gram in set ( ngrams ( field . replace ( ' ' , '' ) , 2 ) ) ) ) ) , ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return ( )