class Dojefiy
Constants
- ADJECTIVES
- VERSION
Public Class Methods
new()
click to toggle source
# File lib/dojefiy.rb, line 8 def initialize @tagger = EngTagger.new end
Public Instance Methods
process( str )
click to toggle source
# File lib/dojefiy.rb, line 12 def process( str ) str.downcase tagged_str = @tagger.add_tags( str ) nouns = @tagger.get_nouns( tagged_str ).keys phrases = nouns.each_with_index.map do |noun, index| "#{adjective(index)} #{noun}." end phrases << "wow." phrases.join(" ").downcase end
Private Instance Methods
adjective(index)
click to toggle source
# File lib/dojefiy.rb, line 25 def adjective index ADJECTIVES[ index % ADJECTIVES.size ] end