zensols.nlparse.wordnet
Wraps the Extended Java WordNet Library.
*dictionary-context*
dynamic
Frameowrk specific variable–use with-context instead of modifying this variable.
adjective-cluster?
(adjective-cluster? synset)
create-dictionary-context
(create-dictionary-context)
(create-dictionary-context resource & {:keys [max-length]})
Create a dictionray context to change the behavior of WordNet lookups.
The type of dictionary is determined by resource, which can be:
- :map MapBackedDictionary, which initializes with the dictionary. This is faster but takes more memory.
- :file FileBackedDictionary, which hits a file (resource in our case) for each lookup. This is slower but takes less memory.
- :default Same as :map and default with 0 arg invocation.
Note that if a token (word or lemma) is not valid per valid-token? then any of the lookup function (i.e. lookup-word) will return an empty list, nil
, or false
depending on the function. See the keys section for more inforamtion.
Keys
- :max-length the maximum length or token that prevents a lookup
has-pos-tag?
(has-pos-tag? lemma pos-tag-name)
Return whether or not the lemmatized word has exists for a POS tag.
- lemma the lemma (or word) to look up in wordnet
- pos-tag-name the name of the pos tag or pos-tag-any
in-dictionary?
(in-dictionary? lemma)
Return whether or not a lemmatized word is in WordNet.
looks-like-word?
(looks-like-word? lemma)
lookup-word
(lookup-word lemma)
(lookup-word lemma pos-tag)
Lookup a word (lemmatized) in wordnet.
- pos-tag type of POS/VERB and one of the pos-noun,verb etc
lookup-word-by-sense
(lookup-word-by-sense sense-key)
Lookup a word by verbnet old sense key.
For example buy%2:40:00::
maps to buy/bought.
pos-adjective
The adjective wordnet API POS tag.
pos-adverb
The adverb wordnet API POS tag.
pos-noun
The noun wordnet API POS tag.
pos-tag-any
Special POS tag to indicate any POS tag (see has-pos-tag?)
pos-tag-set
(pos-tag-set lemma-or-indexed-word)
Return all the POS tags found for a lemmatized word.
pos-tags
All wordnet tags, which include pos-verb, pos-noun, pos-adverb, pos-adjective.
pos-verb
The verb wordnet API POS tag.
present-tense-verb?
(present-tense-verb? word)
Return whether word looks like a present tense word.
synonyms
(synonyms & args)
Get all synonyms for a lemma and return as word objects. This uses lookup-word to get the words, then returns synset words.
See lookup-word for args documentation.
to-present-tense-verb
(to-present-tense-verb word)
Return the present tense of verb.
valid-token?
(valid-token? token)
Return whether or not token is not valid for lookup.
verb-frame-flags
(verb-frame-flags synset)
If synset is a verb type synset return its verb frame flags. Otherwise return nil.
with-context
macro
(with-context context & forms)
Modify the default WordNet dictionary functionality by using a context created with create-dictionary-contxt.
with-dictionary
macro
(with-dictionary dict-sym & forms)
Use a dictionary and set the symbol dict-sym.
Example usage:
(with-dictionary dict
(.lookupAllIndexWords dict))
wordnet-pos-labels
(wordnet-pos-labels)
Return all word used POS tags.