Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling conjunctions when input length is short #151

Open
mchaelkha opened this issue Feb 15, 2024 · 0 comments
Open

Handling conjunctions when input length is short #151

mchaelkha opened this issue Feb 15, 2024 · 0 comments

Comments

@mchaelkha
Copy link

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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant