tck/human-name-parser

There is no license information available for the latest version (v0.1.6) of this package.

Takes human names of arbitrary complexity and various wacky formats and parses them out.

Installs: 42

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 0

Forks: 42

pkg:composer/tck/human-name-parser

v0.1.6 2018-07-02 10:17 UTC

This package is auto-updated.

Last update: 2025-09-13 02:04:11 UTC


README

Forked from [https://github.com/jasonpriem/HumanNameParser.php]

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.

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
  • surname (including compound ones like "van der Sar' and "Ortega y Gasset"), and
  • suffix (like 'Jr.', 'III')

Example Usage

$parser = new Tck\HumanNameParser\Parser("John Q. Smith");
echo  $parser->surname() . ", " . $parser->firstName();
// returns "Smith, John"