merge_machine/preprocess_fields_v3.py
def fast_sim_score(r, l = 1024):
	''' Return a pair (list of matched substrings, score) '''
	if len(r[0]) > 0: return (r[0], 100)
	elif len(r[1]) < 1 and len(r[2]) < 1: return ([], 0)
	elif l > 8: return (r[1], 50) if len(r[1]) > 0 else (r[2], 20)
	elif l > 4: return (r[1], 20) if len(r[1]) > 0 else (r[2], 10)
	else: return (r[1], 5) if len(r[1]) > 0 else ([], 0)
 Return a pair (list of matched substrings, score) 
Return a pair (list of matched substrings, score)
Return a pair ( list of matched substrings score )
def fast_sim_score(r, l = 1024):
	if len(r[0]) > 0: return (r[0], 100)
	elif len(r[1]) < 1 and len(r[2]) < 1: return ([], 0)
	elif l > 8: return (r[1], 50) if len(r[1]) > 0 else (r[2], 20)
	elif l > 4: return (r[1], 20) if len(r[1]) > 0 else (r[2], 10)
	else: return (r[1], 5) if len(r[1]) > 0 else ([], 0)
def fast_sim_score ( r , l = 1024 ) : if len ( r [ 0 ] ) > 0 : return ( r [ 0 ] , 100 ) elif len ( r [ 1 ] ) < 1 and len ( r [ 2 ] ) < 1 : return ( [ ] , 0 ) elif l > 8 : return ( r [ 1 ] , 50 ) if len ( r [ 1 ] ) > 0 else ( r [ 2 ] , 20 ) elif l > 4 : return ( r [ 1 ] , 20 ) if len ( r [ 1 ] ) > 0 else ( r [ 2 ] , 10 ) else : return ( r [ 1 ] , 5 ) if len ( r [ 1 ] ) > 0 else ( [ ] , 0 )
Return a pair (list of matched substrings, score)
Return a pair ( list of matched substrings score )
''' Return a pair (list of matched substrings, score) '''
r
l