<commit_before># NameParser
Parses a name into various parts including:

* Honorific
* First name
* Middle initial
* Last name 
* Suffix

Ported from [php-name-parser](https://code.google.com/archive/p/php-name-parser/). See also [Splitting names](http://www.onlineaspect.com/2009/08/17/splitting-names/).
<commit_msg>Add Implementation Notes<commit_after># NameParser
Parses a name into various parts including:

* Honorific
* First name
* Middle initial
* Last name 
* Suffix

Ported from [php-name-parser](https://code.google.com/archive/p/php-name-parser/). See also [Splitting names](http://www.onlineaspect.com/2009/08/17/splitting-names/).

PHP has a handy [ucfirst](https://secure.php.net/manual/en/function.ucfirst.php) utility that is used in the original implementation. It turns out a Java implementation has already been discussed on StackOverflow in the article "[How to capitalize the first letter of word in a string using java?](http://stackoverflow.com/a/5725949/6146580)."

The PHP code uses a conditional statement and a regular expression to look for words in *Pascal Case* such as McDonald.

```php
function is_camel_case($word) {
    if (preg_match("|[A-Z]+|s", $word) && preg_match("|[a-z]+|s", $word)) 
        return true;
    return false;
}
```

However, I thought I could get the match in a single regular expression. Sure enough, I quickly found one without having to get my hands dirty with the [Online regex tester and debugger](https://regex101.com/#pcre); see "[RegEx to split camelCase or TitleCase (advanced)](http://stackoverflow.com/a/7599674/6146580)."
{'fraction_non_alphanumeric': 0.12067881835323696, 'fraction_numerical': 0.0295411690760528, 'mean_word_length': 4.566433566433567, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2665243', 'n_tokens_mistral': 519, 'n_tokens_neox': 474, 'n_words': 165}