Class EmailNameParserCommand
- java.lang.Object
-
- com.optimaize.command4j.commands.BaseCommand<A,R>
-
- com.optimaize.anythingworks.client.rest.RestBaseCommand<T,A,R>
-
- org.nameapi.client.services.NameApiBaseCommand<org.nameapi.client.services.email.emailnameparser.RestPort,String,org.nameapi.ontology5.services.email.emailnameparser.EmailNameParserResult>
-
- org.nameapi.client.services.email.emailnameparser.EmailNameParserCommand
-
- All Implemented Interfaces:
com.optimaize.command4j.Command<String,org.nameapi.ontology5.services.email.emailnameparser.EmailNameParserResult>,com.optimaize.command4j.commands.CombinableCommand<String,org.nameapi.ontology5.services.email.emailnameparser.EmailNameParserResult>
public class EmailNameParserCommand extends NameApiBaseCommand<org.nameapi.client.services.email.emailnameparser.RestPort,String,org.nameapi.ontology5.services.email.emailnameparser.EmailNameParserResult>
Analyzes the email address and attempts to extract a person's name.Example: john.doe@example.com => [john, doe]
The service attempts to detect several kinds of syntax, such as:
- peter.johnson@example.com
- peter.a.johnson@example.com
- peterjohnson@example.com
- pjohnson@example.com
- peterj@example.com
- peter@example.com
- johnson@example.com
- johnson.peter@example.com
- johnsonpeter@example.com
Names are not formatted to correct case, they are left the way they appeared in the input.
Difference to the older EmailNameParserCommand: The enum EmailAddressParsingResultType2 uses FUNCTIONAL instead of DEPARTMENT and TECHNICAL because the two can hardly be told apart.
-
-
Field Summary
-
Fields inherited from class org.nameapi.client.services.NameApiBaseCommand
CLIENT_VERSION
-
-
Constructor Summary
Constructors Constructor Description EmailNameParserCommand()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.nameapi.ontology5.services.email.emailnameparser.EmailNameParserResultcall(com.google.common.base.Optional<String> arg, com.optimaize.command4j.ExecutionContext ec)protected Callable<org.nameapi.client.services.email.emailnameparser.RestPort>createPort(com.optimaize.command4j.ExecutionContext ec)-
Methods inherited from class org.nameapi.client.services.NameApiBaseCommand
getApiKey, getContext, makeClient
-
Methods inherited from class com.optimaize.anythingworks.client.rest.RestBaseCommand
createCacheKey, getHost, getPort, getPortUrlFactory, makeBaseUrl
-
-
-
-
Method Detail
-
call
@NotNull public org.nameapi.ontology5.services.email.emailnameparser.EmailNameParserResult call(@NotNull com.google.common.base.Optional<String> arg, @NotNull com.optimaize.command4j.ExecutionContext ec) throws Exception- Throws:
Exception
-
createPort
@NotNull protected Callable<org.nameapi.client.services.email.emailnameparser.RestPort> createPort(@NotNull com.optimaize.command4j.ExecutionContext ec)
- Specified by:
createPortin classcom.optimaize.anythingworks.client.rest.RestBaseCommand<org.nameapi.client.services.email.emailnameparser.RestPort,String,org.nameapi.ontology5.services.email.emailnameparser.EmailNameParserResult>
-
-