2017 © Pedro Peláez
 

library human-name-parser

Parses a human name

image

davidgorges/human-name-parser

Parses a human name

  • Tuesday, June 21, 2016
  • by dgorges
  • Repository
  • 1 Watchers
  • 11 Stars
  • 25,500 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 39 Forks
  • 0 Open issues
  • 3 Versions
  • 9 % Grown

The README.md

Latest Stable Version PHPStan Enabled , (*1)


Note: The 1.0 release requires PHP > 7.1., (*2)

Description

Fork from HumanNameParser.php origninally by Jason Priem jason@jasonpriem.com. Takes human names of arbitrary complexity and various wacky formats like:, (*3)

  • J. Walter Weatherman
  • de la Cruz, Ana M.
  • James C. ('Jimmy') O'Dell, Jr.
  • Dr. James C. ('Jimmy') O'Dell, Jr.

and parses out the:, (*4)

  • 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')
  • title (like 'Dr.', 'Prof') new

How to use

use HumanNameParser\Parser;

$nameparser = new Parser();
$name = $nameparser->parse("Alfonso Ribeiro");

echo "Hello " . $name->getFirstName();

The Versions

21/06 2016

dev-master

9999999-dev

Parses a human name

  Sources   Download

MIT

The Requires

  • php >=5.3

 

The Development Requires

by David Gorges

08/10 2014

0.2.1

0.2.1.0

Parses a human name

  Sources   Download

MIT

The Requires

  • php >=5.3

 

The Development Requires

by David Gorges

17/12 2013

0.1.0

0.1.0.0

Parses a human name

  Sources   Download

MIT

The Development Requires

by David Gorges