<commit_before># HumanNameParse.java

![](https://github.com/tupilabs/HumanNameParser.java/workflows/CI/badge.svg)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=tupilabs_HumanNameParser.java&metric=alert_status)](https://sonarcloud.io/dashboard?id=tupilabs_HumanNameParser.java)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=tupilabs_HumanNameParser.java&metric=coverage)](https://sonarcloud.io/dashboard?id=tupilabs_HumanNameParser.java)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.tupilabs/human-name-parser/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.tupilabs/human-name-parser)

Java port Author: <NAME>

Original library Author: <NAME> <EMAIL> (credits go to him)
Original library Author Website: http://jasonpriem.com/human-name-parse

License: [MIT](http://www.opensource.org/licenses/mit-license.php)

## Description
Takes human names of arbitrary complexity and various wacky formats like:

* <NAME> 
* de la Cruz, <NAME>. 
* <NAME>. ('Jimmy') O'Dell, Jr.
* Dr. <NAME>.

and parses out the:

* leading initial (Like "J." in "<NAME>")
* first name (or first initial in a name like '<NAME>')
* nicknames (like "Jimmy" in "<NAME>. ('Jimmy') O'Dell, Jr.")
* middle names
* last name (including compound ones like "<NAME>' and "<NAME>"), and
* suffix (like 'Jr.', 'III')
* salutations (like 'Mr.', 'Mrs.', 'Dr')
* postnominals (like 'PHD', 'CPA')

## Usage

```
<dependencies>
  <dependency>
    <groupId>com.tupilabs</groupId>
    <artifactId>human-name-parser</artifactId>
  </dependency>
</dependencies>
```

```
Name object = new Name("<NAME>");
HumanNameParserParser parser = new HumanNameParserParser(object);
String firstName = parser.getFirst();
String nicknames = parser.getNicknames();
// ...
```

## Changelog

### 0.2 (2020-07-??)

- [#10](https://github.com/tupilabs/HumanNameParser.java/issues/10) support custom
postnominals. We have added a builder to create a parser. It uses the same default
values as before for suffixes, postnominals, prefixes, and salutations. But now
users can tell the builder to replace or append values to these lists.

### 0.1 (2020-04-06)

Initial release to Maven Central<commit_msg>Update readme usage example<commit_after># HumanNameParse.java

![](https://github.com/tupilabs/HumanNameParser.java/workflows/CI/badge.svg)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=tupilabs_HumanNameParser.java&metric=alert_status)](https://sonarcloud.io/dashboard?id=tupilabs_HumanNameParser.java)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=tupilabs_HumanNameParser.java&metric=coverage)](https://sonarcloud.io/dashboard?id=tupilabs_HumanNameParser.java)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.tupilabs/human-name-parser/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.tupilabs/human-name-parser)

Java port Author: <NAME>

Original library Author: <NAME> <EMAIL> (credits go to him)
Original library Author Website: http://jasonpriem.com/human-name-parse

License: [MIT](http://www.opensource.org/licenses/mit-license.php)

## Description
Takes human names of arbitrary complexity and various wacky formats like:

* <NAME> 
* <NAME>, <NAME>. 
* <NAME>. ('Jimmy') O'Dell, Jr.
* Dr. <NAME>.

and parses out the:

* leading initial (Like "J." in "<NAME>")
* first name (or first initial in a name like '<NAME>')
* nicknames (like "Jimmy" in "<NAME>. ('Jimmy') O'Dell, Jr.")
* middle names
* last name (including compound ones like "<NAME>' and "<NAME>"), and
* suffix (like 'Jr.', 'III')
* salutations (like 'Mr.', 'Mrs.', 'Dr')
* postnominals (like 'PHD', 'CPA')

## Usage

```
<dependencies>
  <dependency>
    <groupId>com.tupilabs</groupId>
    <artifactId>human-name-parser</artifactId>
  </dependency>
</dependencies>
```

```
Name name = new Name("<NAME>");
HumanNameParserBuilder builder = new HumanNameParserBuilder(name);
HumanNameParserParser parser = builder.build();
String firstName = parser.getFirst();
String nicknames = parser.getNicknames();
// ...
```

## Changelog

### 0.2 (2020-07-??)

- [#10](https://github.com/tupilabs/HumanNameParser.java/issues/10) support custom
postnominals. We have added a builder to create a parser. It uses the same default
values as before for suffixes, postnominals, prefixes, and salutations. But now
users can tell the builder to replace or append values to these lists.

### 0.1 (2020-04-06)

Initial release to Maven Central
{'fraction_non_alphanumeric': 0.15986769570011025, 'fraction_numerical': 0.009702315325248071, 'mean_word_length': 5.344055944055944, 'pattern_counts': {'":': 0, '<': 46, '<?xml version=': 0, '>': 46, 'https://': 16, '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': '1283274', 'n_tokens_mistral': 1610, 'n_tokens_neox': 1506, 'n_words': 359}