public class NameParser extends Object
Modifier and Type | Field and Description |
---|---|
static float |
TYPOTHRES |
Constructor and Description |
---|
NameParser(String honorificFileName,
String nicknameFileName,
float nickThres)
Constructor to initialize a NameParser object.
|
Modifier and Type | Method and Description |
---|---|
float |
compare(NameParser nameParser)
Compares two strings of type PER that are converted into NameParser
objects.
|
ArrayList<String> |
getArrNameTokens() |
String |
getExtraName() |
String |
getFirstName() |
String |
getHonorific() |
String |
getLastName() |
String |
getMiddleName() |
ArrayList<String> |
getNickNameMapping(String text)
Finds all possible nicknames for the string parameter.
|
boolean |
honorificMatching(String honorific)
Checks if the string parameter is a valid honorific.
|
boolean |
isNickName(String text)
Checks if the string parameter is a valid nickname.
|
void |
parsing(String name)
Parses a given string of type PER, identifying the parts of the name -
first name, last name, honorific, title, etc.
|
void |
resetAll()
Sets all variables to empty strings.
|
public static final float TYPOTHRES
public NameParser(String honorificFileName, String nicknameFileName, float nickThres) throws IOException
honorificFileName
- File name to obtain list of name stringsnicknameFileName
- File name to obtain list of nickname stringsnickThres
- Threshold at which a name is considered a nicknameIOException
public void resetAll()
public void parsing(String name)
name
- String to be parsed using type PERpublic String getHonorific()
public String getFirstName()
public String getMiddleName()
public String getLastName()
public String getExtraName()
public float compare(NameParser nameParser)
nameParser
- The other string of type PER to be compared withpublic boolean honorificMatching(String honorific)
honorific
- String to be checked for honorificpublic boolean isNickName(String text)
text
- String to be checked for nicknameCopyright © 2017. All rights reserved.