Class: Julius::Message::Recogout

Inherits:
Julius::Message show all
Includes:
Enumerable
Defined in:
lib/julius/message.rb

Defined Under Namespace

Classes: Shypo

Instance Method Summary collapse

Methods inherited from Julius::Message

init, #name

Constructor Details

#initialize(element) ⇒ Recogout

Returns a new instance of Recogout.



49
50
51
52
53
54
# File 'lib/julius/message.rb', line 49

def initialize(element)
  @shypo_list = element.elements.map do |element|
    Shypo.new(element)
  end
  super(element)
end

Instance Method Details

#[](nth) ⇒ Object Also known as: at



66
67
68
# File 'lib/julius/message.rb', line 66

def [] nth
  @shypo_list[nth]
end

#each(&block) ⇒ Object



56
57
58
59
60
# File 'lib/julius/message.rb', line 56

def each(&block)
  return self.to_enum unless block_given?
  @shypo_list.each(&block)
  self
end

#firstObject



62
63
64
# File 'lib/julius/message.rb', line 62

def first
  @shypo_list.first
end

#sentenceObject



72
73
74
# File 'lib/julius/message.rb', line 72

def sentence
  self.first.map{|whypo| whypo.to_s }.join
end