https://github.com/tsukasaoishi/word_scoop
WordScoop extracts keywords from among sentences.
https://github.com/tsukasaoishi/word_scoop
keyword pick ruby
Last synced: 7 months ago
JSON representation
WordScoop extracts keywords from among sentences.
- Host: GitHub
- URL: https://github.com/tsukasaoishi/word_scoop
- Owner: tsukasaoishi
- License: mit
- Created: 2009-03-07T08:06:07.000Z (over 16 years ago)
- Default Branch: main
- Last Pushed: 2021-01-19T14:23:14.000Z (almost 5 years ago)
- Last Synced: 2025-03-13T07:01:55.895Z (8 months ago)
- Topics: keyword, pick, ruby
- Language: C
- Homepage:
- Size: 251 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: History.txt
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# WordScoop
[](http://badge.fury.io/rb/word_scoop) [](https://travis-ci.org/tsukasaoishi/word_scoop) [](https://codeclimate.com/github/tsukasaoishi/word_scoop)
WordScoop will pick up keywords that have been pre-registered from the text.
WordScoop is very fast library. The average of registring 1 word time is 0.487 µs. The average of to search time is 1.248 ms.(Be performed on the Macbook air at 2012)
Try ```bundle exec rake benchmark```
## Installation
Add this line to your application's Gemfile:
gem 'word_scoop'
And then execute:
$ bundle
Or install it yourself as:
$ gem install word_scoop
## Usage
Register keywords
keywords = WordScoop.new(["Ruby", "Rails"])
Add keyword
keywords << "Tsukasa"
Pick up the keywords in a text
keywords.search("I Love Ruby") #=> ["Ruby"]
## HTML text support
config replace URL base
keyword.link_url = %Q|%s|
Replace keyword to link
keywords.filter_html("I Love Ruby") #=> %Q|I Love Ruby|
## Rake command
compiling code
$ bundle exec rake compile
run rspec
$ bundle exec rake spec
run benchmark test
$ bundle exec rake benchmark
## Contributing
1. Fork it ( https://github.com/[my-github-username]/word_scoop/fork )
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