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

Last, First, Suffix pattern is not parsed properly #18

Closed
adrienne opened this issue May 19, 2019 · 4 comments · Fixed by #19
Closed

Last, First, Suffix pattern is not parsed properly #18

adrienne opened this issue May 19, 2019 · 4 comments · Fixed by #19

Comments

@adrienne
Copy link

adrienne commented May 19, 2019

One common (if slightly archaic) way of listing names is as follows:

Lastname, Firstname (optional middle initial or name), Suffix

for example:

Tiptree, James, Jr.
which the parser parses as:

[
lastname => string (13) "Tiptree James"
suffix => string (2) "Jr"
]

and

Miller, Walter M., Jr.
which the parser parses as:

[
firstname => string (6) "Walter"
lastname => string (9) "Miller M."
suffix => string (2) "Jr"
]

Interestingly, if you remove the second comma, the names behave differently.

Tiptree, James Jr. still fails (it drops the suffix):

[
firstname => string (5) "James"
lastname => string (7) "Tiptree"
]

Miller, Walter M. Jr. correctly parses into firstname/initial/lastname/suffix, as shown:

[
firstname => string (6) "Walter"
lastname => string (6) "Miller"
initials => string (2) "M."
suffix => string (2) "Jr"
]

So, definitely a few problems to fix here!

@adrienne
Copy link
Author

(In general, this parser is the best one I've found; among other things, it's the only one that I've found that correctly handles mononyms. So i'd really love it if this could get fixed!)

@adrienne
Copy link
Author

adrienne commented May 28, 2019

@wyrfel possibly I should tag you on this? You seem to be a maintainer!

@wyrfel
Copy link
Contributor

wyrfel commented May 29, 2019

Hey @adrienne. Thanks for reporting the issue (and the nice feedback, btw). I'll look into it as soon as i can.

@wyrfel
Copy link
Contributor

wyrfel commented Jun 3, 2019

@adrienne I was unable to reproduce the issue with with the lastname, firstname, suffix patterns.
I have added test cases for the scenarios you reported here and the tests are not failing.

I have also made a slight modification in this PR to allow the parsing of e.g. 'Jr.' as suffix instead of middle name in 'Tiptree, James Jr.'.

Could you please make sure you are using the latest version and could you let me now if you have made any configuration changes, language changes or any other customisations?

@wyrfel wyrfel closed this as completed in #19 Jun 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants