Closed helper2424 closed 6 years ago
But 'Pope' is not a given name, is it? So I would seriously question that 'Benedict XVI, Pope' is a valid input. I think an appropriate parsing would be either literal: 'Pope Benedict XVI'
or something like
given: 'Benedict', title: 'Pope', suffix: 'XVI'
.
Namae.parse 'Pope Benedict XVI'
=> [#<Name family="Benedict" given="Pope" suffix="XVI">]
You could adjust the lexer patterns in Namae::Parser.instance.options
to accept 'Pope' as a title (but that's dangerous because 'Pope' is also a valid name).
Yep, you right. Pope is not a given. It's title. https://en.wikipedia.org/wiki/Pope_Benedict_XVI . Origin string I get from third-party API, so need some non empty result.
Example
Namae.parse 'Benedict XVI, Pope'
=> []
If use capital case it's work:
Namae.parse 'Benedict Xvi, Pope'
=> [#<Name family="Benedict Xvi" given="Pope">]