RedditBagOfWords

Retrieves a bag of words model from a subreddit

Installation

Add this line to your application's Gemfile:

gem 'reddit_bag_of_words'

And then execute:

$ bundle

Or install it yourself as:

$ gem install reddit_bag_of_words

Usage

 request = RedditBagOfWords.new('http://reddit.com/r/programming.json')
 # returns bag of words hash
 request.titles_bag = { :a => 1,
                 :b => 2,
                  ...
                }
  # returns string collection of words found
  request.string_titles_bag = { 'b a b' }

  request.descriptions_bag = { :a => 1,
                  :b => 2,
                   ...
                 }
  request.string_descriptions_bag = { 'b a b' }

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request