covectric
Covectric is a simple vector based search engine using cosine similarity and tf–idf methods for finding text similarity between documents.
Define "covectric"
Two documents are said to be covectric if they share at least one dimension (or term).
Install
> npm install covectric
Usage
//instantiate the modelvar covectric = ;var model = ; //populate the vector space and weight tokens based on term frequencyvar id = 1;'hello''hi''hi there''hey''hi to you';model; //search the vector space var results = model;console;
Samples
See the samples directory in the repo for more examples of using Covectric
Reference
http://en.wikipedia.org/wiki/Vector_space_model
http://en.wikipedia.org/wiki/Cosine_similarity
http://en.wikipedia.org/wiki/Tf-idf
License
MIT Licensed