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
- Host: GitHub
- URL: https://github.com/abachman/human_name_parser
- Owner: abachman
- License: mit
- Created: 2011-11-10T21:51:02.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2013-05-28T15:02:20.000Z (almost 13 years ago)
- Last Synced: 2025-08-01T10:00:50.240Z (9 months ago)
- Topics: ruby, rubygem
- Language: Ruby
- Homepage:
- Size: 169 KB
- Stars: 7
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
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"