WordNet::

SemanticLink class

WordNet semantic link (pointer) model class

Public Instance Methods

linkid()

The ID of this semlink

# File lib/wordnet/semanticlink.rb, line 14
        
origin()

The “origin” WordNet::Synset associated with this SemanticLink

# File lib/wordnet/semanticlink.rb, line 19
many_to_one :origin,
        class: 'WordNet::Synset',
        key: :synset1id,
        primary_key: :synsetid
target()

The “target” WordNet::Synset associated with this SemanticLink

# File lib/wordnet/semanticlink.rb, line 26
one_to_one :target,
        class: 'WordNet::Synset',
        key: :synsetid,
        primary_key: :synset2id,
        eager: :words
to_s()

Return a stringified version of the SemanticLink.

# File lib/wordnet/semanticlink.rb, line 38
def to_s
        return "%s: %s (%s)" % [
                self.type,
                self.target.words.map( &:to_s ).join( ', ' ),
                self.target.pos,
        ]
end
type()

Return the type of link as a Symbol.

# File lib/wordnet/semanticlink.rb, line 48
def type
        return WordNet::Synset.linktype_table[ self.linkid ][ :type ]
end
typename()

Return the name of the link type as a String.

# File lib/wordnet/semanticlink.rb, line 54
def typename
        return WordNet::Synset.linktype_table[ self.linkid ][ :typename ]
end