[ 
https://issues.apache.org/jira/browse/SANDBOX-487?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14264079#comment-14264079
 ] 

Bruno P. Kinoshita commented on SANDBOX-487:
--------------------------------------------

> Keep in mind different cultures construct names in different ways. Terms like 
> "first name" and "last name" are relative - they depend on the culture. Plus, 
> there may be multiple "middle" names - paternal and maternal middle names for 
> example.

The PHP library has an interesting issue on how [Russian names are 
abbreviated|https://github.com/jasonpriem/HumanNameParser.php/issues/6]. There 
are other examples, such as ["Yu. 
Gagarin"|http://english.stackexchange.com/a/34088], and several prefixes that 
exist in Brazilian Portuguese, such as Nhô, Sinhô, Sinhozinho, Dom, Seu, Dona, 
etc, that are not used in other languages.

Maybe we could create parser with different behaviours, such as the parsers in 
[csv]. 

Like:

{noformat}
HumanNameParser parser = HumanNameParser.parse("Jackie Chan", 
HumanNameParserFormat.JAPANESE);
parser.getFirst(); // Jackie
parser.getLast(); // <empty>
parser.getSuffix(); // Chan - chan is a suffix used for children, girls, etc
{noformat}

{noformat}
HumanNameParser parser = HumanNameParser.parse("Jackie Chan", 
HumanNameParserFormat.CHINESE);
parser.getFirst(); // Jackie
parser.getLast(); // Chan - more common as surname in Chinese
parser.getSuffix(); // <empty>
{noformat}

So each language would define prefixes, suffixes, and the regexes for first, 
last and middle name. 

WDYT?

> Human name parser
> -----------------
>
>                 Key: SANDBOX-487
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-487
>             Project: Commons Sandbox
>          Issue Type: Improvement
>          Components: Commons Text
>            Reporter: Bruno P. Kinoshita
>            Priority: Minor
>              Labels: name, parser, text
>
> The project 
> [HumanNameParser.java|http://tupilabs.github.io/HumanNameParser.java/] is a 
> port to Java of the 
> [HumanNameParser.php|http://jasonpriem.org/human-name-parse/], both licensed 
> under the MIT License. 
> This issue was created to discuss a similar parser, based on the Java 
> version, to the [text] component.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to