HumanNameParser.java
HumanNameParser.java, a Java port of HumanNameParser.php. Parser for human names in Java, all credit goes to @jasonpriem
Install / Use
/learn @tupilabs/HumanNameParser.javaREADME
HumanNameParse.java
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
Description
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')
Usage
<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();
// ...
Changelog
0.3 (2025-08-02)
- #15 JUnit Jupiter migration (thanks to @mureinik).
- #17 Fix for HumanNameParser incorrectly interprets some name components as postnominals (thanks to @CarlosManuelRodr).
0.2 (2020-07-09)
- #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
Related Skills
node-connect
346.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
346.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
346.8kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
