public class MultiWords
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
<any> |
multiWord
A Multimap of String keys and String values.
|
Constructor and Description |
---|
MultiWords() |
Modifier and Type | Method and Description |
---|---|
void |
addMultiWord(java.lang.String word)
Add a multi-word string to the multiWord member variable.
|
int |
findMultiWord(java.util.List<java.lang.String> text,
int startIndex,
java.util.List<java.lang.String> synset)
Find the synset for a multi-word string, if it exists.
|
int |
findMultiWord(java.lang.String multiWordKey,
java.lang.String nonRoot,
java.util.List<java.lang.String> multiWordTail,
java.util.List<java.lang.String> synset) |
static java.lang.String |
rootFormOf(java.lang.String word) |
public <any> multiWord
public void addMultiWord(java.lang.String word)
word
- should already have had any spaces replaced by underscorespublic int findMultiWord(java.util.List<java.lang.String> text, int startIndex, java.util.List<java.lang.String> synset)
text
- is an array of String words.startIndex
- is the first word in the array to look atsynset
- is an array of only one element, if a synset is found
and empty otherwisepublic int findMultiWord(java.lang.String multiWordKey, java.lang.String nonRoot, java.util.List<java.lang.String> multiWordTail, java.util.List<java.lang.String> synset)
nonRoot
- is the non root form of the potential multiword headword.
We need to try both the root form and the original form,
which includes capitalized and lower case versions.public static java.lang.String rootFormOf(java.lang.String word)