No description or website provided.
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
spec
.gitignore
.rvmrc
.travis.yml
Gemfile
README.md
README.md.docu
Rakefile
komainu.gemspec

README.md

komainu

A very simple text search tool.

Build Status

Examples

Simple Search

require "komainu"
require "ostruct"

item1 = OpenStruct.new
item1.text = "You are a smelly pirate hooker."

item2 = OpenStruct.new
item2.text = "You look like a blueberry."

item3 = OpenStruct.new
item3.text = "Why don't you go back to your home on Whore Island?"

searchables = [item1, item2]
Komainu.search("blue", searchables)

#=> {:suggestion=>nil, :items=>["You look like a blueberry."]}

Suggestions

require "komainu"
require "ostruct"

item = OpenStruct.new
item.text = "Batman has no parents :("
searchables = [item]
Komainu.search("betman", searchables)

#=> {:suggestion=>"Batman", :items=>[]}