dice-coefficient
Advanced tools
Comparing version 1.0.0 to 1.0.1
21
cli.js
#!/usr/bin/env node | ||
/** | ||
* @author Titus Wormer | ||
* @copyright 2014 Titus Wormer | ||
* @license MIT | ||
* @module dice-coefficient | ||
* @fileoverview CLI for `dice-coefficient`. | ||
*/ | ||
'use strict'; | ||
/* Dependencies. */ | ||
var pack = require('./package.json'); | ||
var dice = require('./'); | ||
/* Arguments. */ | ||
var argv = process.argv.slice(2); | ||
@@ -40,7 +30,3 @@ | ||
/** | ||
* Get the edit distance for a list of words. | ||
* | ||
* @param {Array.<string>} values | ||
*/ | ||
/* Get the edit distance for a list of words. */ | ||
function getEditDistance(values) { | ||
@@ -55,7 +41,2 @@ if (values.length === 2) { | ||
/** | ||
* Help. | ||
* | ||
* @return {string} | ||
*/ | ||
function help() { | ||
@@ -62,0 +43,0 @@ return [ |
18
index.js
@@ -1,24 +0,8 @@ | ||
/** | ||
* @author Titus Wormer | ||
* @copyright 2014 Titus Wormer | ||
* @license MIT | ||
* @module dice-coefficient | ||
* @fileoverview Sørensen–Dice coefficient. | ||
*/ | ||
'use strict'; | ||
/* Dependencies. */ | ||
var bigrams = require('n-gram').bigram; | ||
/* Expose. */ | ||
module.exports = diceCoefficient; | ||
/** | ||
* Get the edit-distance according to Dice between two values. | ||
* | ||
* @param {*} value - First value. | ||
* @param {*} right - Second value. | ||
* @return {number} Edit distance. | ||
*/ | ||
/* Get the edit-distance according to Dice between two values. */ | ||
function diceCoefficient(value, alternative) { | ||
@@ -25,0 +9,0 @@ var left = bigrams(String(value).toLowerCase()); |
{ | ||
"name": "dice-coefficient", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Sørensen–Dice coefficient", | ||
@@ -14,10 +14,2 @@ "license": "MIT", | ||
], | ||
"dependencies": { | ||
"n-gram": "^0.1.2" | ||
}, | ||
"files": [ | ||
"index.js", | ||
"cli.js" | ||
], | ||
"bin": "cli.js", | ||
"repository": "https://github.com/wooorm/dice-coefficient", | ||
@@ -29,21 +21,22 @@ "bugs": "https://github.com/wooorm/dice-coefficient/issues", | ||
], | ||
"engines": { | ||
"node": ">=0.11.0" | ||
"bin": "cli.js", | ||
"files": [ | ||
"index.js", | ||
"cli.js" | ||
], | ||
"dependencies": { | ||
"n-gram": "^1.0.0" | ||
}, | ||
"devDependencies": { | ||
"browserify": "^13.0.0", | ||
"browserify": "^14.0.0", | ||
"esmangle": "^1.0.0", | ||
"execa": "^0.4.0", | ||
"has": "^1.0.1", | ||
"nyc": "^7.1.0", | ||
"remark-cli": "^1.0.0", | ||
"remark-comment-config": "^4.0.0", | ||
"remark-github": "^5.0.0", | ||
"remark-lint": "^4.0.0", | ||
"remark-validate-links": "^4.0.0", | ||
"execa": "^0.7.0", | ||
"nyc": "^11.0.0", | ||
"remark-cli": "^3.0.0", | ||
"remark-preset-wooorm": "^3.0.0", | ||
"tape": "^4.4.0", | ||
"xo": "^0.16.0" | ||
"xo": "^0.18.0" | ||
}, | ||
"scripts": { | ||
"build-md": "remark . --quiet --frail", | ||
"build-md": "remark . -qfo", | ||
"build-bundle": "browserify index.js -s diceCoefficient > dice-coefficient.js", | ||
@@ -65,19 +58,15 @@ "build-mangle": "esmangle dice-coefficient.js > dice-coefficient.min.js", | ||
"space": true, | ||
"esnext": false, | ||
"rules": { | ||
"unicorn/explicit-length-check": "off" | ||
}, | ||
"ignores": [ | ||
"dice-coefficient.js", | ||
"dice-coefficient.min.js" | ||
"dice-coefficient.js" | ||
] | ||
}, | ||
"remarkConfig": { | ||
"output": true, | ||
"plugins": { | ||
"comment-config": null, | ||
"lint": null, | ||
"github": null, | ||
"validate-links": null | ||
}, | ||
"settings": { | ||
"bullet": "*" | ||
} | ||
"plugins": [ | ||
"preset-wooorm" | ||
] | ||
} | ||
} |
@@ -18,6 +18,6 @@ # dice-coefficient [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] | ||
dice('abc', 'abc'); // 1 | ||
dice('abc', 'xyz'); // 0 | ||
dice('night', 'nacht'); // 0.25 | ||
dice('night', 'nacht') === dice('NiGhT', 'NACHT'); // true | ||
dice('abc', 'abc'); //=> 1 | ||
dice('abc', 'xyz'); //=> 0 | ||
dice('night', 'nacht'); //=> 0.25 | ||
dice('night', 'nacht') === dice('NiGhT', 'NACHT'); //=> true | ||
``` | ||
@@ -24,0 +24,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
8
0
6337
86
+ Addedn-gram@1.1.2(transitive)
- Removedn-gram@0.1.2(transitive)
Updatedn-gram@^1.0.0