public class WordNetExplorer
extends java.lang.Object
Constructor and Description |
---|
WordNetExplorer(java.io.File wordNetData)
Initialize the WordNetExplorer
|
WordNetExplorer(java.lang.String wordNetData)
Initialize the WordNetExplorer
|
WordNetExplorer(java.net.URL wordNetUrl)
Initialize the WordNetExplorer using a URL location for the data files
|
Modifier and Type | Method and Description |
---|---|
boolean |
canExplore(PartOfSpeech pos)
Return whether this WordNetExplorer can handle a particular part of
speech.
|
java.lang.String |
getBaseWord(java.lang.String word,
PartOfSpeech pos)
Get the base word for a particular word.
|
java.io.File |
getDirectory()
Get the directory location of the WordNet files
|
java.util.Set<java.lang.String> |
getParentConcepts(java.lang.String word,
PartOfSpeech pos)
Get the hierarchical set of hypernyms for the word.
|
java.util.Set<java.lang.String> |
getRelated(java.lang.String pattern)
Get the related terms from an encoded pattern.
|
java.util.Set<java.lang.String> |
getRelated(java.lang.String word,
PartOfSpeech pos,
int[] senses,
java.lang.String flags)
Get related terms and concepts for a particular word.
|
java.util.Set<java.lang.String> |
getRelated(java.lang.String word,
PartOfSpeech pos,
java.lang.String flags)
Get related terms and concepts for a particular word.
|
java.util.List<java.lang.String> |
getSenseDescriptions(java.lang.String word,
PartOfSpeech pos)
Get the list of sense descriptions for the given word.
|
java.util.Set<java.lang.String> |
getSynonyms(java.lang.String word,
PartOfSpeech pos)
Get synonyms for a particular word.
|
java.util.Set<java.lang.String> |
getSynonyms(java.lang.String word,
PartOfSpeech pos,
int[] senses)
Get synonyms for a particular word.
|
public WordNetExplorer(java.io.File wordNetData)
wordNetData
- the directory where the data files reside.public WordNetExplorer(java.lang.String wordNetData)
wordNetData
- the directory where the data files reside.public WordNetExplorer(java.net.URL wordNetUrl)
wordNetUrl
- the directory where the data files reside.public boolean canExplore(PartOfSpeech pos)
pos
- the part of speech to explorepublic java.lang.String getBaseWord(java.lang.String word, PartOfSpeech pos)
word
- the word to stempos
- the part of speech, or nullpublic java.io.File getDirectory()
public java.util.Set<java.lang.String> getParentConcepts(java.lang.String word, PartOfSpeech pos)
word
- the word to checkpos
- the part of speechpublic java.util.Set<java.lang.String> getRelated(java.lang.String pattern)
Get the related terms from an encoded pattern. The pattern argument includes optional parts of speech, senses, and tags. The pattern format is word:X#.#.#:tags, where word represents the word to match. X is a character representing part of speech (n for noun, v for verb, a for adjective, or r for adverb). The # symbols are sense numbers, matching the sense number for the word and part of speech. They are optional, but the part of speech character must be specified if one or more sense numbers are specified. The tags are a collection of symbols matching the Pointer symbols of WordNet. See the WordNet documentation for the pointer symbols. In addition to the pointer symbols, the pipe symbol ('|') represents synonyms.
All parts of the pattern are optional except the word. If the part of speech character is missing, then all parts of speech will be used. Likewise, if no senses are specified, all will be used. If no tags are specified, then only the base word (and its stem) will be returned.
pattern
- the pattern to match for related termspublic java.util.Set<java.lang.String> getRelated(java.lang.String word, PartOfSpeech pos, int[] senses, java.lang.String flags)
word
- the word to checkpos
- the part of speechsenses
- the sense numbers. If null, all senses are usedflags
- the set of lexicographer symbols, concatenated togetherpublic java.util.Set<java.lang.String> getRelated(java.lang.String word, PartOfSpeech pos, java.lang.String flags)
word
- the word to checkpos
- the part of speechflags
- the set of lexicographer symbols, concatenated togetherpublic java.util.List<java.lang.String> getSenseDescriptions(java.lang.String word, PartOfSpeech pos)
word
- the word to checkpos
- the part of speechpublic java.util.Set<java.lang.String> getSynonyms(java.lang.String word, PartOfSpeech pos)
word
- the word to checkpos
- the part of speechpublic java.util.Set<java.lang.String> getSynonyms(java.lang.String word, PartOfSpeech pos, int[] senses)
word
- the word to checkpos
- the part of speechsenses
- the sense numbers. If null, all senses are used