class Uwn::Api::Meaning

Class for Abstract UWN Statement wrapper (with some high level functions)

Attributes

connect[RW]
language[RW]
parent[RW]
statements[RW]
term[RW]

Public Class Methods

new(options={}) click to toggle source
# File lib/uwn/api/meaning.rb, line 10
def initialize options={}
  self.connect = options[:connect] if options.include? :connect
  self.term = options[:term] if options.include? :term
  self.language = options[:language] if options.include? :language
  self.statements = []
end

Public Instance Methods

append_statement(statement) click to toggle source

append a statement, and wrap with a Statement object

# File lib/uwn/api/meaning.rb, line 23
def append_statement statement
  self.statements << Statement.new(parent: self, object: statement)
end
glosses() click to toggle source
# File lib/uwn/api/meaning.rb, line 41
def glosses
  self.statements.flat_map{ |s| s.glosses }
end
has_meaning?() click to toggle source

contains a statement set?

# File lib/uwn/api/meaning.rb, line 18
def has_meaning?
  !self.statements.empty?
end
lexical_categories() click to toggle source
# File lib/uwn/api/meaning.rb, line 49
def lexical_categories
  self.statements.flat_map{ |s| s.lexical_categories }
end
lexicalizations() click to toggle source
# File lib/uwn/api/meaning.rb, line 37
def lexicalizations
  self.statements.flat_map{ |s| s.lexicalizations }
end
subclasses() click to toggle source
# File lib/uwn/api/meaning.rb, line 45
def subclasses
  self.statements.flat_map{ |s| s.subclasses }
end
synonyms() click to toggle source
# File lib/uwn/api/meaning.rb, line 33
def synonyms
  self.statements.flat_map{ |s| s.synonyms }
end
synsets() click to toggle source

short handeded (high level) methods

# File lib/uwn/api/meaning.rb, line 29
def synsets
  self.statements.flat_map{ |s| s.synsets }
end