[READ-ONLY] Mirror of https://github.com/FoxxMD/string-sameness. Compare the sameness of two strings foxxmd.github.io/string-sameness/
compare cosine-similarity dice-coefficient levenshtein-distance sameness string text typescript
0

Configure Feed

Select the types of activity you want to include in your feed.

refactor: Replace dice-coefficient from unmaintained library

FoxxMD (Feb 15, 2024, 10:29 AM EST) 3d954e31 950b8b78

+17 -9
+1
.gitignore
··· 8 8 /.idea 9 9 /docs 10 10 .tshy 11 + .tshy-build-tmp
+2 -2
package.json
··· 49 49 "typescript": "^4.9.5" 50 50 }, 51 51 "dependencies": { 52 - "leven": "^3.0.0", 53 - "string-similarity": "^4.0.4" 52 + "dice-coefficient": "^2.1.1", 53 + "leven": "^3.0.0" 54 54 }, 55 55 "tshy": { 56 56 "exports": {
+2 -2
src/matchingStrategies/diceSimilarity.ts
··· 1 - import stringSimilarity from 'string-similarity'; 1 + import {diceCoefficient} from 'dice-coefficient'; 2 2 import {ComparisonStrategy, ComparisonStrategyResultObject} from "../atomic.js"; 3 3 4 - export const calculateDiceSimilarity = (valA: string, valB: string) => stringSimilarity.compareTwoStrings(valA, valB); 4 + export const calculateDiceSimilarity = (valA: string, valB: string) => diceCoefficient(valA, valB); 5 5 export const diceStrategy: ComparisonStrategy<ComparisonStrategyResultObject> = { 6 6 name: 'dice', 7 7 strategy: (valA: string, valB: string) => {
+12 -5
yarn.lock
··· 298 298 dependencies: 299 299 type-detect "^4.0.0" 300 300 301 + dice-coefficient@^2.1.1: 302 + version "2.1.1" 303 + resolved "https://registry.yarnpkg.com/dice-coefficient/-/dice-coefficient-2.1.1.tgz#d8ebb51f021ab6069994e7ef36842184771f616f" 304 + integrity sha512-vPTcHmOQAuGvU6eyBtj7QCBwDJh2I7QpbBU51lbgfv7592KjBl6dm0baRBSh9ekt2X91MNAz7OpJrXCIUtDzlw== 305 + dependencies: 306 + n-gram "^2.0.0" 307 + 301 308 diff@5.0.0: 302 309 version "5.0.0" 303 310 resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" ··· 631 638 resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" 632 639 integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== 633 640 641 + n-gram@^2.0.0: 642 + version "2.0.2" 643 + resolved "https://registry.yarnpkg.com/n-gram/-/n-gram-2.0.2.tgz#e544a7dffefc49c22d898b2f491e787941b3a2ba" 644 + integrity sha512-S24aGsn+HLBxUGVAUFOwGpKs7LBcG4RudKU//eWzt/mQ97/NMKQxDWHyHx63UNWk/OOdihgmzoETn1tf5nQDzQ== 645 + 634 646 nanoid@3.3.3: 635 647 version "3.3.3" 636 648 resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.3.tgz#fd8e8b7aa761fe807dba2d1b98fb7241bb724a25" ··· 780 792 version "0.6.1" 781 793 resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" 782 794 integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== 783 - 784 - string-similarity@^4.0.4: 785 - version "4.0.4" 786 - resolved "https://registry.yarnpkg.com/string-similarity/-/string-similarity-4.0.4.tgz#42d01ab0b34660ea8a018da8f56a3309bb8b2a5b" 787 - integrity sha512-/q/8Q4Bl4ZKAPjj8WerIBJWALKkaPRfrvhfF8k/B23i4nzrlRj2/go1m90In7nG/3XDSbOo0+pu6RvCTM9RGMQ== 788 795 789 796 "string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0: 790 797 version "4.2.3"