Home | Trees | Indices | Help |
|
---|
|
object --+ | Synset
A set of synonyms.
Each synset contains one or more Senses, which represent a specific sense of a specific word. Senses can be retrieved via synset.getSenses() or through the index notations synset[0], synset[string], or synset[word]. Synsets also originate zero or more typed pointers, which can be accessed via synset.getPointers() or synset.getPointers(pointerType). The targets of a synset pointer can be retrieved via synset.getPointerTargets() or synset.getPointerTargets(pointerType), which are equivalent to map(Pointer.getTarget(), synset.getPointerTargets(...)).
>>> from nltk_lite.wordnet import * >>> V['think'][0].synset.verbFrames (5, 9)
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
|
|||
|
Initialize the Synset from a line in a WordNet synset file.
|
Return a dictionary of synsets If pointerType is specified, only pointers of that type are returned. In this case, pointerType should be an element of POINTER_TYPES.
|
>>> from nltk_lite.wordnet import * >>> N['dog'][0].isTagged() 1 >>> N['dog'][1].isTagged() 0
|
Return a human-readable representation. >>> from nltk_lite.wordnet import * >>> str(N['dog'][0].synset) '{noun: dog, domestic dog, Canis familiaris}'
|
repr(x)
|
|
|
Return the transitive closure of source under the rel relationship, breadth-first >>> dog = N['dog'][0] >>> dog.closure(HYPERNYM) [{noun: dog, domestic dog, Canis familiaris}, {noun: canine, canid}, {noun: carnivore}, {noun: placental, placental mammal, eutherian, eutherian mammal}, {noun: mammal, mammalian}, {noun: vertebrate, craniate}, {noun: chordate}, {noun: animal, animate being, beast, brute, creature, fauna}, {noun: organism, being}, {noun: living thing, animate thing}, {noun: object, physical object}, {noun: physical entity}, {noun: entity}] |
Get the path(s) from this synset to the root, where each path is a list of the synset nodes traversed on the way to the root.
|
Get the path(s) from this synset to the root, counting the distance of each node from the initial node on the way. A list of (synset, distance) tuples is returned. |
Returns the distance of the shortest path linking the two synsets (if one exists). For each synset, all the ancestor nodes and their distances are recorded and compared. The ancestor node common to both synsets that can be reached with the minimum number of traversals is used. If no ancestor nodes are common, -1 is returned. If a node is compared with itself 0 is returned.
|
Get the Information Content value of this Synset, using the supplied dict 'freq_data'.
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0beta1 on Wed May 16 22:47:32 2007 | http://epydoc.sourceforge.net |