Skip to content

IbrahimShamma99/text-similarity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

text-similarity-scorer

npm

text-similarity-scorer is your goto similarity score between two strings

For more informatiom about the future of the package, check out the discussion here.

Table of contents

Install

npm i --save text-similarity-scorer

Usage

const similarity = require("text-similarity-scorer");

const score = similarity(
  "I HAVE A DREAM", //first sentence
  "I HAD A NAP" //second sentence
);
// NOTE : Order matters
console.log(score);
/*
{
  matched: [ 0, -1, 2, -1 ],
  matchScore: [ 1, 0, 1, 0 ],
  exact: 2,
  literal: 0,
  score: 2,
  score_pct: 0.5,
  order: 1,
  size: 0.25
}
*/

To Do

  • Adding ability to choose similarity algorithm

License

MIT

About

Sentences relatedness checker

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published