Skip to content

Latest commit

 

History

History
18 lines (14 loc) · 604 Bytes

File metadata and controls

18 lines (14 loc) · 604 Bytes

javascript-text-search

A simple javascript library searches term against list of strings using Cosine Similarity

To enable partial matches, the dataset and the search term are tokenized using NGram

usage

const TextSearch = require('text-search')
index = new TextSearch({
        fuzzyMatch: true,
        nGramLowerLimit: 3,
        nGramUpperLimit: 4,
        dataSet: ['George', 'John', 'Thomas', 'James', 'Andrew']
      })
console.log(index.search('Tho'))