GithubHelp home page GithubHelp logo

indexsegment.js's Introduction

IndexSegment.js Build Status

A JS in memory search index.

Installation

$ npm install index-segment

Usage

//
// Basic usage usages the built in tokenizer
// which is pretty trivial and splits strings on
// non alpha numeric characters.
//
var IndexSegment = require('index-segment');

// create your index
var index = new IndexSegment();

// put(docText, docId)
index.put("hey-you", 1);
//> 2

index.put("hey you me", 2);
//> 3

index.search("me");
//> [2]

index.search("hey");
//> [1, 2]

Providing your own tokenizer.

The tokenizer is used during put and search methods.

var index = new IndexSegment(myTokenizer);

Development

Clone it :)

I'm using es6->es5 via babel, and polyfilling in Set and Map.

Run gulp for the es5 translation.

npm test for running the tests.

License

MIT

Author

Stan Rozenraukh

indexsegment.js's People

Contributors

stanistan avatar

Watchers

 avatar James Cloos avatar

Forkers

lawrence34

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.