merge_machine/preprocess_fields_v3.py
def validate_person_name(s):
	''' Validator for items of type: full person name '''
	for i, (r, firstGp, lastGp) in enumerate(PERSON_NAME_EXTRACTION_PATS):
		m = r.match(s)
		if m:
			logging.debug('Person name pattern #%d matched: %s', i + 1, '; '.join(m.groups()))
			fst = m.group(firstGp).strip()
			lst = (m.group(lastGp) if lastGp >= 0 else s.replace(m.group(firstGp), '')).strip()
			if validate_first_name(fst) and validate_last_name(lst):
				return { F_FIRST: fst, F_LAST: lst }
	return None
 Validator for items of type: full person name 
Validator for items of type: full person name
Validator for items of type : full person name
def validate_person_name(s):
	for i, (r, firstGp, lastGp) in enumerate(PERSON_NAME_EXTRACTION_PATS):
		m = r.match(s)
		if m:
			logging.debug('Person name pattern #%d matched: %s', i + 1, '; '.join(m.groups()))
			fst = m.group(firstGp).strip()
			lst = (m.group(lastGp) if lastGp >= 0 else s.replace(m.group(firstGp), '')).strip()
			if validate_first_name(fst) and validate_last_name(lst):
				return { F_FIRST: fst, F_LAST: lst }
	return None
def validate_person_name ( s ) : for i , ( r , firstGp , lastGp ) in enumerate ( PERSON_NAME_EXTRACTION_PATS ) : m = r . match ( s ) if m : logging . debug ( 'Person name pattern #%d matched: %s' , i + 1 , '; ' . join ( m . groups ( ) ) ) fst = m . group ( firstGp ) . strip ( ) lst = ( m . group ( lastGp ) if lastGp >= 0 else s . replace ( m . group ( firstGp ) , '' ) ) . strip ( ) if validate_first_name ( fst ) and validate_last_name ( lst ) : return { F_FIRST : fst , F_LAST : lst } return None
Validator for items of type: full person name
Validator for items of type : full person name
''' Validator for items of type: full person name '''
s