npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

simmetrics-lodash

v0.9.0

Published

An optimized port of the SimMetrics Java library

Downloads

2

Readme

JavaScript port of the SimMetrics Java library plus more.

Installation

In your project

npm install --save '@kba/simmetrics'

Usage

This module exports the file tree in ./lib as an object, i.e. relative path from ./lib equals object path:

var simmetrics = require('@kba/simmetrics');
var MogenElkan = simmetrics.similaritymetrics.MongeElkan;
…

This is a further fork from msamblet's version, which is a fork from novacrazy's version. I'm focused on a few additional things:

  • Make this library produce the same values as the java version (important!) So far this means better results for
    • ChapmanMatchingSoundex
    • Levenshtein
    • MongeElkan
    • SmithWatermanGotoh
    • NeedlemanWunch
  • Automated testing
  • Work with node.js
  • Adding SmithWatermanGotoh metrics support.

Changelog

0.8.13

Improved README

0.8.12

  • Actually export the functions
  • Fix syntax errors

0.8.11

  • Fixed tests

0.8.10

combined with previous versions, the above focus points are in place (node.js support, testing, certain metrics) and is now published as an npm module (and I changed the name of the repo to match). This version just updates the readme.

Usage

See the test folder

simmetrics.test.js is a good place to start.

Developer getting started

npm install
npm install -g mocha

and then to run all the tests:

mocha

##ToDo

  1. The following metrics still seem to generate different answers than the java version, and need to be corrected.
    • EuclideanDistance
    • MatchingCoefficient
    • MongeElkan
    • OverlapCoefficient
    • QGramsDistance

Contributors

See [https://github.com/kba/simmetrics/graphs/contributors]

General Description

Hand-optimized and re-factored to provide clean and fast string similarity algorithms for JavaScript developers.

Although this is designed for Node.js, I will provide a browser version sometime in the future (or if anyone would like to contribute one).

So far, nearly all parts of the library have been ported. Algorithms left to be added are:

  • TagLink
  • TagLinkToken

I should have those up very soon.

A note I should make:

I did not include the original timing tests for each one. I think they are unnecessary. However, as they can be useful sometimes, I will include them sometime as seperate modules which can be merged into the algorithms.

Soundex Notes

Soundex works as an object created by new, in which case the normal soundex function is called as instance.soundex(input[, length]); OR you can simply call the Soundex function directly as Soundex(input[, length]);

Also, it does not include the hyphen between the leading letter and the soundex numbers.