Java port Author: Bruno P. Kinoshita
Original library Author: Jason Priem (credits go to him) Original library Author Website: https://github.com/jasonpriem/HumanNameParser.php
License: MIT
Takes human names of arbitrary complexity and various wacky formats like:
- J. Walter Weatherman
- de la Cruz, Ana M.
- James C. ('Jimmy') O'Dell, Jr.
- Dr. Omar A.
and parses out the:
- leading initial (Like "J." in "J. Walter Weatherman")
- first name (or first initial in a name like 'R. Crumb')
- nicknames (like "Jimmy" in "James C. ('Jimmy') O'Dell, Jr.")
- middle names
- last name (including compound ones like "van der Sar' and "Ortega y Gasset"), and
- suffix (like 'Jr.', 'III')
- salutations (like 'Mr.', 'Mrs.', 'Dr')
- postnominals (like 'PHD', 'CPA')
<dependencies>
<dependency>
<groupId>com.tupilabs</groupId>
<artifactId>human-name-parser</artifactId>
</dependency>
</dependencies>
Name name = new Name("Sérgio Vieira de Mello");
HumanNameParserBuilder builder = new HumanNameParserBuilder(name);
HumanNameParserParser parser = builder.build();
String firstName = parser.getFirst();
String nicknames = parser.getNicknames();
// ...
- #15 JUnit Jupiter migration (thanks to @mureinik).
- #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.
- Initial release to Maven Central