Class: Furigana::Reader

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

Instance Method Summary collapse

Instance Method Details

#reading(text) ⇒ Object



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

def reading(text)
  Mecab.tokenize(text).inject([]) do |list, token|
    with_furigana = add_furigana(token)
    list += with_furigana if with_furigana
    list
  end
end