Socket
Socket
Sign inDemoInstall

ngram-fingerprint

Package Overview
Dependencies
1
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ngram-fingerprint

JS version of ngram-fingerprint from Open Refine


Version published
Weekly downloads
2
decreased by-33.33%
Maintainers
1
Install size
19.1 kB
Created
Weekly downloads
 

Readme

Source

ngram-fingerprint

WindowsMac/Linux
Windows Build statusBuild Status

JavaScript implementation of the ngram-fingerprint algorithm from the Open Refine project described here.

Algorithm

The algorithm is slightly different to the one by Google Refine. The replacements of extended western characters is already done in the third step and not as the last step. This is mostly done so the sorting will work properly.

  1. change all characters to their lowercase representation
  2. remove all punctuation, whitespace, and control characters
  3. normalize extended western characters to their ASCII representation
  4. obtain all the string n-grams
  5. sort the n-grams and remove duplicates
  6. join the sorted n-grams back together

Usage

var fingerprint = require('ngram-fingerprint')

fingerprint(2, 'paris') // returns arispari

Keywords

FAQs

Last updated on 12 Dec 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc