Skip to content

Handling conjunctions when input length is short #151

@mchaelkha

Description

@mchaelkha

The following condition causes single letter conjunctions '&' to not behave the same as multi letter conjunctions in the default conjunctions list. This issue only happens when parsing a name that results in the total_length being less than 4. Example is "mr. and mrs. john smith" parses differently than "mr. & mrs. john smith".
{'title': 'mr.', 'first': '&', 'middle': 'mrs. john', 'last': 'smith', 'suffix': '', 'nickname': ''}

This is what I expect the parser to output.
{'title': 'mr. & mrs.', 'first': 'john', 'middle': '', 'last': 'smith', 'suffix': '', 'nickname': ''}

The condition should always respect any single characters inside the configured conjunctions list.

if len(pieces[i]) == 1 and total_length < 4:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions