Class: ColorfulReading::Tagger
- Inherits:
-
Object
- Object
- ColorfulReading::Tagger
- Defined in:
- lib/colorful_reading/tagger.rb
Instance Method Summary collapse
-
#initialize ⇒ Tagger
constructor
A new instance of Tagger.
- #tagging(text) ⇒ Object
Constructor Details
#initialize ⇒ Tagger
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.(text) || "" facing_spaces + tagged_text end |