commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bruno P. Kinoshita (JIRA)" <>
Subject [jira] [Commented] (SANDBOX-498) Improve HumanNameParser
Date Mon, 20 Apr 2015 03:42:58 GMT


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:

// 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");

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:
>             Project: Commons Sandbox
>          Issue Type: Improvement
>          Components: Commons Text
>            Reporter: Bruno P. Kinoshita
>            Assignee: Benedikt Ritter
>            Priority: Minor
>              Labels: Refactoring
> From
> - 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

View raw message