This package has been deprecated

Author message:

No longer maintained.

matchscr

1.0.2 • Public • Published

matchscr

Travis npm npm

Configurable fuzzy string matching and scoring

Installation

npm install matchscr

Usage

const score = require('matchscr');

score('Hello World!', 'world'); // -> 1
score('Hello World!', 'lll'); // ~> 0.745

Explaination

The returned score is a number between 0 and 1 where 0 stands for no match and 1 for a complete contiguous occurrence of the query strings in the searched string. The more the query string is divided, the lower the score.

Configuration

The config function returns a different score function with the custom configuration applied. The configuration below is the default.

const score = require('matchscr').config({
	ignoreCase: true
});

Readme

Keywords

none

Package Sidebar

Install

npm i matchscr

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

3.85 kB

Total Files

6

Last publish

Collaborators

  • mpt