class SuggestKeywords

Constants

KEYWORDS

Public Class Methods

scan(text) click to toggle source
# File lib/suggest-keywords.rb, line 105
def self.scan(text)
        text = text.gsub(/[()]/, "")
        key_words = []
        string_matches = []
        KEYWORDS.each do |key|
                if key[2].match?(text)
                        key_words << key[0]
                        string_matches << key[2].match(text)
                end

        end
                
        print "suggest keywords = #{key_words} \n\n"
        print "parts of the text matched for each keyword, in order: \n \n"
        string_matches.each do |key|
                puts key
        end
        print "\n"
end