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
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request