All Projects → words → dice-coefficient

words / dice-coefficient

Licence: MIT license
Sørensen–Dice coefficient

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to dice-coefficient

levenshtein.c
Levenshtein algorithm in C
Stars: ✭ 77 (+108.11%)
Mutual labels:  similarity, edit-distance
tex-course-index-template
A template for writing a condensed course index leveraging LaTeX indexing
Stars: ✭ 30 (-18.92%)
Mutual labels:  index
NDD
Drug-Drug Interaction Predicting by Neural Network Using Integrated Similarity
Stars: ✭ 25 (-32.43%)
Mutual labels:  similarity
d20
A fast, powerful, and extensible dice engine for D&D, d20 systems, and any other system that needs dice!
Stars: ✭ 78 (+110.81%)
Mutual labels:  dice
edit-distance-papers
A curated list of papers dedicated to edit-distance as objective function
Stars: ✭ 49 (+32.43%)
Mutual labels:  edit-distance
index shotgun
duplicate index checker 🔥 🔫 👮
Stars: ✭ 35 (-5.41%)
Mutual labels:  index
Duplicate-Image-Finder
difPy - Python package for finding duplicate or similar images within folders
Stars: ✭ 187 (+405.41%)
Mutual labels:  similarity
indexList
微信小程序字母索引
Stars: ✭ 45 (+21.62%)
Mutual labels:  index
PolyDiceGenerator
A customizable Polyhedral Dice Generator for OpenSCAD.
Stars: ✭ 63 (+70.27%)
Mutual labels:  dice
luke
Please use the luke bundled with lucene! This repo is archived and frozen now.
Stars: ✭ 101 (+172.97%)
Mutual labels:  index
BertSimilarity
Computing similarity of two sentences with google's BERT algorithm。利用Bert计算句子相似度。语义相似度计算。文本相似度计算。
Stars: ✭ 348 (+840.54%)
Mutual labels:  similarity
dice-simulator
A Python simple Dice Simulator just for fun
Stars: ✭ 17 (-54.05%)
Mutual labels:  dice
bigdata-tech-index
Big Data Technology Index
Stars: ✭ 24 (-35.14%)
Mutual labels:  index
NasdaqCloudDataService-SDK-Java
Nasdaq Data Link provides a modern and efficient method of delivery for real-time exchange data and other financial information. This repository provides a Java SDK for developing applications using Nasdaq Data Link's real-time data.
Stars: ✭ 70 (+89.19%)
Mutual labels:  index
kdtree-rs
K-dimensional tree in Rust for fast geospatial indexing and lookup
Stars: ✭ 137 (+270.27%)
Mutual labels:  index
Quickenshtein
Making the quickest and most memory efficient implementation of Levenshtein Distance with SIMD and Threading support
Stars: ✭ 204 (+451.35%)
Mutual labels:  edit-distance
nxontology
NetworkX-based Python library for representing ontologies
Stars: ✭ 45 (+21.62%)
Mutual labels:  similarity
LinSpell
Fast approximate strings search & spelling correction
Stars: ✭ 52 (+40.54%)
Mutual labels:  edit-distance
mongodb-chemistry
Ideas for chemical similarity searches in MongoDB.
Stars: ✭ 23 (-37.84%)
Mutual labels:  similarity
indexd
An external bitcoind index management service module
Stars: ✭ 50 (+35.14%)
Mutual labels:  index

dice-coefficient

Build Coverage Downloads Size

Sørensen–Dice coefficient.

Install

This package is ESM only: Node 12+ is needed to use it and it must be imported instead of required.

npm:

npm install dice-coefficient

API

This package exports the following identifiers: diceCoefficient. There is no default export.

import {diceCoefficient} from 'dice-coefficient'

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

Instead of strings you can also pass lists of bigrams. This can improve performance when processing the same strings repeatedly.

diceCoefficient(['ab', 'bc'], ['xy', 'yz']) // => 0
diceCoefficient(['ab', 'bc'], ['ab', 'bc']) // => 1
diceCoefficient(['ab', 'bc'], ['AB', 'BC']) // => 1

See n-gram for generating bigrams.

import {bigram} from 'n-gram'

const abc = bigram('abc') // => ['ab', 'bc']
const xyz = bigram('xyz') // => ['xy', 'yz']

diceCoefficient(abc, xyz) // => 0

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

Related

License

MIT © Titus Wormer

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].