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

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

> Should the HumanNameParser be renamed to WesternNameParser? It certainly can 
> not parse Japanese names, can it?

Let's add a configuration object passed in the constructor. Maybe it could have 
an option that defined the strategy used for parsing the name? This way we 
could have a strategy (or rule set) for each language:

{noformat}
// ParserOptions options = ParserOptions.DEFAULT_OPTIONS; // EN_US
ParserOptions options = ParserOptions.JP; // Japanese names
options.setSurnameFirst = FALSE; // Sometimes the surname may come first, or 
not... 
HumanNameParser parser = new HumanNameParser(options);
Name name = parser.parse("Yoshita Kinoshita");
//...
{noformat}

Though I'd be inclined to postpone this change to later, maybe a 2.0 release. 
This way we could first collect other suggestions from users and enhance the 
design of the parser. 

What do you think? 

> Improve HumanNameParser
> -----------------------
>
>                 Key: SANDBOX-498
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-498
>             Project: Commons Sandbox
>          Issue Type: Improvement
>          Components: Commons Text
>            Reporter: Bruno P. Kinoshita
>            Assignee: Benedikt Ritter
>            Priority: Minor
>              Labels: Refactoring
>
> From http://markmail.org/thread/da7ayocit2dl4otv
> - The constructor of the parser takes configuration options which can be
> reused for several names to parse
> - the parse method takes a string as parameter, containing a name
> - the parse method returns an immutable Name objects which has getters for
> firstName, lastName etc.



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

Reply via email to