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

dice-coefficient

Package Overview
Dependencies
Maintainers
2
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

  • 1.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7.9K
increased by0.85%
Maintainers
2
Weekly downloads
 
Created
Source

dice-coefficient

Build Coverage Downloads Size

Sørensen–Dice coefficient.

Install

npm:

npm install dice-coefficient

API

var dice = require('dice-coefficient')

dice('abc', 'abc') // => 1
dice('abc', 'xyz') // => 0
dice('night', 'nacht') // => 0.25
dice('night', 'nacht') === dice('NiGhT', 'NACHT') // => true

CLI

Usage: dice-coefficient [options] <word> <word>

Sørensen–Dice coefficient

Options:

  -h, --help           output usage information
  -v, --version        output version number

Usage:

# output edit distance
$ dice-coefficient night nacht
# 0.25

# output edit distance from stdin
$ echo "saturday sunday" | dice-coefficient
# 0.3333333333333333

License

MIT © Titus Wormer

Keywords

FAQs

Package last updated on 18 May 2019

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