public class AcronymManager extends Object
Constructor and Description |
---|
AcronymManager(String acronymFileName)
Constructor to initialize an AcronymManager object, which is used to
determine if a string or a pair of strings should be assigned type ORG.
|
Modifier and Type | Method and Description |
---|---|
float |
acronymScoring(ArrayList<String> candidates1,
ArrayList<String> candidates2)
Helper scoring function used to score strings designated ORG.
|
float |
acronymScoring(String name1,
String name2)
Helper scoring function used to score strings designated ORG.
|
String |
findAcronym(String longName)
Finds the possible acronyms of a long string (presumably multiple words)
with and without words like "of, at, the" included in the abbreviated
form.
|
List<String> |
getLongForm(String acronym) |
List<String> |
getShortForm(String longform) |
boolean |
isAcronymFirstLetters(String shortName,
String longName)
Returns true if the shorter string is an abbreviation, or a variant of
acceptable ones, of the longer string.
|
boolean |
isAcronymPair(String acronym,
String fullName)
More rigorously defined than isAcronymFirstLetters; returns true if the
shorter string is exactly an acronym of the longer string.
|
boolean |
isSpecificCase() |
void |
readAcronymFile() |
float |
scoring(NameInfo name1Info,
NameInfo name2Info)
Primary scoring function called by EntityComparison.
|
public AcronymManager(String acronymFileName) throws IOException
acronymFileName
- File name to obtain list of acronymsIOException
public float acronymScoring(String name1, String name2)
name1
- First of two type ORG strings to be comparedname2
- Second of two type ORG strings to be comparedpublic boolean isSpecificCase()
public float acronymScoring(ArrayList<String> candidates1, ArrayList<String> candidates2)
candidates1
- ArrayListcandidates2
- ArrayListpublic float scoring(NameInfo name1Info, NameInfo name2Info)
name1Info
- First NameInfo object to be comparedname2Info
- Second NameInfo object to be comparedpublic String findAcronym(String longName)
longName
- The longer of two strings being comparedpublic boolean isAcronymFirstLetters(String shortName, String longName)
shortName
- Shorter of two strings being comparedlongName
- Longer of two strings being comparedpublic boolean isAcronymPair(String acronym, String fullName)
acronym
- Shorter of the two stringsfullName
- Longer of the two stringspublic void readAcronymFile() throws IOException
IOException
Copyright © 2017. All rights reserved.