Exemplo n.º 1
0
print( "Name list: " + str( name_part_list ) + "; len: " + str( name_part_count ) )

# first, see if two words.
if ( name_part_count == 2 ):

    # yes.  See if parsed name has first and last name.
    if ( ( parsed.first == "" ) or ( parsed.last == "" ) ):
    
        # no, parser results in empty first name or last name.  See if there is a
        #    match for the three most likely potential interpretations of a two-
        #    word name - all first, all last, or first-last.

        # both in first
        hn_first = HumanName()
        hn_first.first = name
        person_first = Person.get_person_for_name( name, create_if_no_match_IN = True, parsed_name_IN = hn_first )
        status_first = Person.get_person_lookup_status( person_first )
        print( "status from both in first: " + status_first )
    
        # first then last
        hn_first_last = HumanName()
        hn_first_last.first = name_part_list[ 0 ]
        hn_first_last.last = name_part_list[ 1 ]
        person_first_last = Person.get_person_for_name( name, create_if_no_match_IN = True, parsed_name_IN = hn_first_last )
        status_first_last = Person.get_person_lookup_status( person_first_last )
        print( "status from first then last: " + status_first_last )

        # both in last
        hn_last = HumanName()
        hn_last.last = name
        person_last = Person.get_person_for_name( name, create_if_no_match_IN = True, parsed_name_IN = hn_last )