Class: WordNet::SemanticLink
- Inherits:
-
Object
- Object
- WordNet::SemanticLink
- 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
-
#to_s ⇒ Object
Return a stringified version of the SemanticLink.
-
#type ⇒ Object
Return the type of link as a Symbol.
-
#typename ⇒ Object
Return the name of the link type as a String.
Instance Method Details
#to_s ⇒ Object
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 |
#type ⇒ Object
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 |
#typename ⇒ Object
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 |