JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 24364
  • Score
    100M100P100Q218548F
  • License MIT

Sørensen–Dice coefficient

Package Exports

  • dice-coefficient

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (dice-coefficient) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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