Giter Club home page Giter Club logo

sigmod-fingerprinting's Introduction

Sigmod Fingerprinting

Python implementation of the algorithm defined in Winnowing: Local Algorithms for Document Fingerprinting.

Installation

git clone https://github.com/mattstruble/sigmod-fingerprinting.git
cd sigmod-fingerprinting && python setup.py install

Usage

>>> from sigmod_fingerprinting.fingerprint import Fingerprint


>>> fingerprint = Fingerprint(kgram_len=5, window_len=4)
>>> fingerprint.generate("A do run run run, a do run run")
[[639355869, 0], [2552422548, 1], [8796342234, 5], [8796342217, 8], [8728864700, 11], [639355869, 12], [2552422548, 13]]

Results are an array of pairs representing [hash, index].

Variables

The variables that can be passed into the Fingerprint class are as follows:

name purpose
kgram_len Defines the length of kgrams to generate. The example above generates ['adoru', 'dorun', ...]
window_len Defines the size of the window when comparing the kgram hashes for fingerprint selection. The larger the window the fewer fingerprints that are returned.
modulo The value to modulo the hashes by, defaults to sys.maxsize.
base The base in which to use for hashing, defaults to 158 to accomodate all alphanumeric characters uniquely.
allow_space Determines whether the sanitizer will allow spaces in the final kgrams. Defaults to False.

sigmod-fingerprinting's People

Contributors

mattstruble avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.