Project

komainu

0.0
No commit activity in last 3 years
No release in over 3 years
Simple text search using a mixture of basic string search and Levenshtein Distance
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
 Project Readme

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=>[]}