Class: ColorfulReading::Tagger

Inherits:
Object
  • Object
show all
Defined in:
lib/colorful_reading/tagger.rb

Instance Method Summary collapse

Constructor Details

#initializeTagger

Returns a new instance of Tagger.



5
6
7
# File 'lib/colorful_reading/tagger.rb', line 5

def initialize
  @tagger = EngTagger.new
end

Instance Method Details

#tagging(text) ⇒ Object



9
10
11
12
13
# File 'lib/colorful_reading/tagger.rb', line 9

def tagging(text)
  facing_spaces = text.scan(/\A\s+/).first || ""
  tagged_text = @tagger.add_tags(text) || ""
  facing_spaces + tagged_text
end