Module: Namae
- Defined in:
- lib/namae/utility.rb,
lib/namae/name.rb,
lib/namae/parser.rb,
lib/namae/version.rb
Overview
Namae is a parser for human names. It recognizes personal names of various cultural backgrounds and tries to split them into their component parts (e.g., given and family names, honorifics etc.).
The main use case of Namae is to use the .parse or .parse! method to parse a string of names and return a list of Name objects.
Defined Under Namespace
Modules: NameFormatting, Version Classes: Name, Parser
Class Method Summary collapse
- .configure {|Hash| ... } ⇒ Object
-
.options ⇒ Hash
The parser’s current configuration.
-
.parse(names) ⇒ Array
Parses the passed-in string and returns a list of names.
-
.parse!(names) ⇒ Array
Parses the passed-in string and returns a list of names.
Class Method Details
.configure {|Hash| ... } ⇒ Object
48 49 50 |
# File 'lib/namae/utility.rb', line 48 def configure yield Parser.defaults end |
.options ⇒ Hash
Returns the parser’s current configuration.
43 44 45 |
# File 'lib/namae/utility.rb', line 43 def Parser.instance. end |
.parse(names) ⇒ Array
Parses the passed-in string and returns a list of names. Behaves like parse but returns an empty list for bad input without raising an error.
28 29 30 |
# File 'lib/namae/utility.rb', line 28 def parse(names) Parser.instance.parse(names) end |
.parse!(names) ⇒ Array
Parses the passed-in string and returns a list of names.
38 39 40 |
# File 'lib/namae/utility.rb', line 38 def parse!(names) Parser.instance.parse!(names) end |