Class: WordNet::SemanticLink

Inherits:
Object
  • Object
show all
Includes:
Constants
Defined in:
lib/wordnet/semanticlink.rb

Overview

WordNet semantic link (pointer) model class

Constant Summary

Constants included from Constants

Constants::DEFAULT_DB_OPTIONS, Constants::DELIM, Constants::DELIM_RE, Constants::DOMAIN_TYPES, Constants::DomainSymbols, Constants::HOLONYM_SYMBOLS, Constants::HOLONYM_TYPES, Constants::HYPERNYM_SYMBOLS, Constants::HYPERNYM_TYPES, Constants::HYPONYM_SYMBOLS, Constants::HYPONYM_TYPES, Constants::LEXFILES, Constants::MEMBER_SYMBOLS, Constants::MEMBER_TYPES, Constants::MERONYM_SYMBOLS, Constants::MERONYM_TYPES, Constants::POINTER_SUBTYPES, Constants::POINTER_SYMBOLS, Constants::POINTER_TYPES, Constants::SUB_DELIM, Constants::SUB_DELIM_RE, Constants::SYNTACTIC_CATEGORIES, Constants::SYNTACTIC_SYMBOLS, Constants::VERB_SENTS

Instance Method Summary collapse

Instance Method Details

#to_sObject

Return a stringified version of the SemanticLink.



31
32
33
34
35
36
37
# File 'lib/wordnet/semanticlink.rb', line 31

def to_s
	return "%s: %s (%s)" % [
		self.type,
		self.target.words.map( &:to_s ).join( ', ' ),
		self.target.pos,
	]
end

#typeObject

Return the type of link as a Symbol.



41
42
43
# File 'lib/wordnet/semanticlink.rb', line 41

def type
	return WordNet::Synset.linktype_table[ self.linkid ][ :type ]
end

#typenameObject

Return the name of the link type as a String.



47
48
49
# File 'lib/wordnet/semanticlink.rb', line 47

def typename
	return WordNet::Synset.linktype_table[ self.linkid ][ :typename ]
end