An open API service indexing awesome lists of open source software.

https://github.com/abachman/human_name_parser

A name parsing library
https://github.com/abachman/human_name_parser

ruby rubygem

Last synced: 8 months ago
JSON representation

A name parsing library

Awesome Lists containing this project

README

          

Attempt to parse and categorize the parts of names. Almost entirely focused on "western" style names.

With code borrowed from:

* https://github.com/bricooke/name_parser
* https://github.com/jasonpriem/HumanNameParser.php
* https://github.com/jconley88/NameParser

Built for use in [Tixato](http://tixato.com) by [Figure 53](http://figure53.com).

## Install

`gem install human_name_parser`

## Usage

require 'rubygems'
require 'human_name_parser'

name = HumanNameParser.parse 'George W. Bush Jr.'
name.first # => 'George'
name.last # => 'Bush'
name.initials # => 'GWB'
name.suffix # => 'Jr.'
name.to_s # => 'George W. Bush Jr.'

## Development

~/ $ git clone ... && cd human_name_parser
~/ $ bundle install
~/ $ rake

## TODO

Handle nicknames

Handle strangely placed commas

Handle multiple last names. e.g., "Björn Charles O'Malley y Muñoz"

Handle multiple first names. e.g., "Mary Joe Francis Smith"