Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/FullNameParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,11 @@ public function parse_name($full_name) {
if ($this->is_compound($word) && $i != 0) {
break;
}
# move on to parsing the last name if we find an indicator of a double-barrelled (hyphenated) AND compound last name (Von, Van, etc)
# we use $i != 0 to allow for cases where an indicator is actually a hyphenated first name (like "Betty-May")
if(str_contains($word, '-') && $i != 0) {
break;
}
# is it a middle initial or part of their first name?
# if we start off with an initial, we'll call it the first name
if ($this->is_initial($word)) {
Expand Down