Class: Furigana::Reader

Inherits:
Object
  • Object
show all
Defined in:
lib/furigana/reader.rb

Instance Method Summary collapse

Instance Method Details

#reading(text) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/furigana/reader.rb', line 6

def reading(text)
  Mecab.tokenize(text).reduce([]) do |list, token|
    with_reading = add_reading(token)
    list += with_reading if with_reading
    list
  end
end