public class LinguisticUtil extends Object
| Constructor and Description |
|---|
LinguisticUtil() |
| Modifier and Type | Method and Description |
|---|---|
String[] |
getAllHyponymsForWord(String word,
net.didion.jwnl.data.POS pos)
Iterates through the hypernym tree for the given word at the given POS and returns a list of all lemmas of the
most frequent synsets visited during traversing the tree.
|
static LinguisticUtil |
getInstance() |
String |
getNormalizedForm(String word)
Returns the normalized form of the given word.
|
Set<WordNet.LemmaScorePair> |
getScoredHyponyms(String word,
net.didion.jwnl.data.POS pos) |
String[] |
getSynonymsForWord(String word)
Returns an array of all synonyms for the given word.
|
String[] |
getSynonymsForWord(String word,
net.didion.jwnl.data.POS pos)
Returns an array of all synonyms for the given word for the given POS.
|
String[] |
getTopSynonymsForWord(String word,
int n)
Returns an array of the lemmas of the top
n synonyms for the given word. |
String[] |
getWordsFromCamelCase(String camelCase)
Processes the given string and puts camelCased words into single words.
|
String[] |
getWordsFromUnderscored(String underScored)
Split word into words it contains divided by underscores.
|
static void |
main(String[] args) |
public LinguisticUtil()
public static LinguisticUtil getInstance()
public Set<WordNet.LemmaScorePair> getScoredHyponyms(String word, net.didion.jwnl.data.POS pos)
public String[] getWordsFromCamelCase(String camelCase)
camelCase - the word containing camelcase to splitpublic String[] getWordsFromUnderscored(String underScored)
underScored - word to split at underscorespublic String[] getSynonymsForWord(String word)
RELEVANT_POS are
returned.word - the word to retrieve synonyms forpublic String[] getAllHyponymsForWord(String word, net.didion.jwnl.data.POS pos)
word - word to get hypernyms forpos - POS to get hypernyms forpublic String[] getSynonymsForWord(String word, net.didion.jwnl.data.POS pos)
word - the word to retrieve synonyms forpos - POS to retrieve synonyms forpublic String[] getTopSynonymsForWord(String word, int n)
n synonyms for the given word. Only synonyms for the POS in
RELEVANT_POS are returned.word - the word to retrieve synonyms forn - the number of senses to get lemmas forpublic String getNormalizedForm(String word)
word - the word to get normalized form for
DL-Learner is licenced under the terms of the GNU General Public License.
Copyright © 2007-2019 Jens Lehmann