Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- text = %q{Los Angeles has some of the nicest weather in the country.}
- stop_words = %w{the a by on for of are with just but and to in the my I has some}
- words = text.scan(/\w+/)
- key_words = words.select { |bob| !stop_words.include?(bob) }
- puts key_words.join(' ')
Add Comment
Please, Sign In to add comment