Method: WordNet::Synset#relation

Defined in:
lib/rwordnet/synset.rb

#relation(pointer_symbol) ⇒ Object

Get an array of Synsets with the relation ‘pointer_symbol` relative to this Synset. Mostly, this is an internal method used by convience methods (e.g. Synset#antonym), but it can take any valid valid pointer_symbol defined in pointers.rb.

Example (get the gloss of an antonym for ‘fall’):

WordNet::Lemma.find("fall", :verb).synsets[1].relation("!")[0].gloss


186
187
188
189
# File 'lib/rwordnet/synset.rb', line 186

def relation(pointer_symbol)
  @pointers.select { |pointer| pointer.symbol == pointer_symbol }.
    map! { |pointer| Synset.new(@synset_type, pointer.offset) }
end