RubyGems Navigation menu

goto_string 0.1.3

FEATURES/PROBLEMS: * Partial string matching * The algorithm is not particularly performant == SYNOPSIS: require ‘goto_string’ s = %w(goto_string is a small library that implements a substring matching and ranking algorithm. The matching and ranking is similar to that found in Quicksilver or TextMate) GotoString::Matcher.match(‘string’, s) #=> [["goto_string", "goto_string", 0.679259259259259, [["string", 5]]], ["substring", "substring", 0.461481481481481, [["s", 0], ["tring", 4]]]] An array is returned which contains one entry for each match. Matches are ordered by rank. Each match is itself an array, containing the following elements: [ "matched string", "original candidate", rank, [["substring_1", offset], ["substring_2", offset], … ] ] You can optionally pass a block to the match method which will get each candidate passed to it. The return value of the block is what will be used for matching. This is so you can pass in arrays of complex objects as candidates: GotoString::Matcher.matching( "goto", Project.find(:all) ) do |p| p.name end The resulting matches will contain a reference to the matched string (the project name) as well as the project (the original candidate) == REQUIREMENTS: * None

Gemfile:
= Copier Copié!

installation:
=

Versions:

  1. 0.1.4 - August 16, 2007* (6,5 ko)
  2. 0.1.3 - July 19, 2007* (6,5 ko)
  3. 0.1.2 - July 19, 2007* (6,5 ko)
  4. 0.1.1 - July 19, 2007* (5,5 ko)
  5. 0.1.0 - July 19, 2007* (5,5 ko)

Dépendances de Runtime (1):

hoe >= 1.2.1

Propriétaires:

Auteurs:

  • Max Muermann

Total de contrôle SHA 256:

e09eed56e1583e2ef8c289d89424f3697fd4c2ee8e86df6dbf6a42a61115299e

Total de téléchargements 20 137

Pour cette version 3 816

License:

aucune

Version de Ruby requise: > 0.0.0

Liens: