Because of a lapse in government funding, the information on this website may not be up to date, transactions submitted via the website may not be processed, and the agency may not be able to respond to inquiries until appropriations are enacted. The NIH Clinical Center (the research hospital of NIH) is open. For more details about its operating status, please visit cc.nih.gov. Updates regarding government operating status and resumption of normal operations can be found at OPM.gov.
SPT - Synonyms Source Design
I. Introduction
Synonyms are read in from file(s) and kept in the following table:
Vector<SynonymObj>
to keep all synonym information
Hashtable<String, Vector<Integer>>
to keep the indexes of each word
Theoretically, all synonyms are symmetric (bi-directional), so only one (direction) synonym is needed to read in from users. The system will automatically generate the symmetric synonym. In addition, duplicated synonyms are ignored. This information is stored in a Vector of Synonym pairs as a result of:
II. Algorithm
III. Java Classes
IV. Example
Inputs:
Vector<Synonym> synonymList_
index | Synonym | |
---|---|---|
word | synonym | |
0 | dog | canine |
1 | canine | dog |
2 | cat | feline |
3 | feline | cat |
4 | canine | mutt |
5 | mutt | canine |
Hashtable<String, Vector<Integer>> synonymIndex_
key | Values |
---|---|
word | Vector<Integer> |
dog | [0] |
canine | [1, 4] |
cat | [2] |
feline | [3] |
mutt | [5] |