Project

word_scoop

0.0
No commit activity in last 3 years
No release in over 3 years
WordScoop will pick up keywords that have been pre-registered from the text.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

< 2.0, >= 1.3.0
>= 0.8.7
>= 0
 Project Readme

WordScoop

Gem Version Build Status Code Climate

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|<a href="http://ja.wikipedia.org/wiki/%s">%s</a>|

Replace keyword to link

keywords.filter_html("I Love Ruby") #=> %Q|I Love <a href="http://ja.wikipedia.org/wiki/Ruby">Ruby</a>|

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