Giter Club home page Giter Club logo

clevermatcher's Introduction

##CleverMatcher

CleverMatcher is (or at least as a stone soup, aspires to be) an extremely efficient fuzzy text search for applications with autocompletion widgets. It's largely inspired by Sublime Text's autocompletion behavior, having a developed preference for matching acronym shorthands to their expansions.

CleverMatcher wants you to type in shorthand. CleverMatcher will always understand.

###Example

var ms = matchset([
  ['Binding Lantern Smith', 0],
  ['Hopeful Woods', 1],
  ['blustery_green', 2],
  ['Holy Sword', 3]
]);

ms.seek('bl');

yields

[ { score: 15,
    key: 0,
    text: 'Binding Lantern Smith' },
  { score: 11,
    key: 2,
    text: 'blustery_green' } ]

###API If no keys are specified, a text's index will be injected as its key

var ms = matchset(['Binding Lantern Smith', 'Hopeful Woods', 'blustery_green', 'Holy Sword']);

This matchset will be equivalent to the above

You can control the number of results you'll get, and have CleverMatcher give you match html text that highlights the leters matched.

var ms = matchset(sameListAsAbove, 'hot-pink');
ms.seek('hs', 1);

returns

[ { score: 15,
    matched: '<span class="hot-pink">H</span>oly <span class="hot-pink">S</span>word',
    key: 3,
    text: 'Holy Sword' } ]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.