Class: Juman::Result

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/juman/result.rb

Instance Method Summary collapse

Constructor Details

#initialize(lines) ⇒ Result

Returns a new instance of Result.



4
5
6
# File 'lib/juman/result.rb', line 4

def initialize(lines)
  @morphemes = lines.map{|line| Morpheme.new(line) }
end

Instance Method Details

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



17
18
19
# File 'lib/juman/result.rb', line 17

def [](nth)
  @morphemes[nth]
end

#each(&block) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/juman/result.rb', line 8

def each(&block)
  if block_given?
    @morphemes.each(&block)
    self
  else
    self.to_enum
  end
end