Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dice-coefficient

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dice-coefficient

Sørensen–Dice coefficient

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.7K
decreased by-77.1%
Maintainers
1
Weekly downloads
 
Created
Source

dice-coefficient Build Status Coverage Status

The Sørensen–Dice coefficient algorithm in JavaScript.

Installation

npm:

$ npm install dice-coefficient

Component:

$ component install wooorm/dice-coefficient

Bower:

$ bower install dice-coefficient

Usage

var diceCoefficient = require('dice-coefficient');

diceCoefficient("abc", "abc"); // 1
diceCoefficient("abc", "xyz"); // 0
diceCoefficient("night", "nacht"); // 0.25

/* Case insensitive */
diceCoefficient("night", "nacht") === diceCoefficient("NiGhT", "NACHT"); // true

Other Dice-coefficient implementations

Benchmark

Run the benchmark yourself:

$ npm run benchmark

On a MacBook Air, it runs about 725,000 op/s, which is more than 4 times faster than natural.

           dice-coefficient
  725 op/s » op/s * 1,000

           natural
  158 op/s » op/s * 1,000

           clj-fuzzy
   9 op/s » op/s * 1,000

License

MIT © Titus Wormer

Keywords

FAQs

Package last updated on 21 Sep 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc