Git Product home page Git Product logo

node-soundex's Introduction

Soundex (v0.2.1)

Install: npm install soundex

This project is Unlicensed. In other words, I don't care what you do with it. However, if you make something interesting, I would like to check it out.

Information:

Well, the wiki article probably says enough. Find it here.

NOTE: I've completely changed the way this works for better scaling support.

Usage:

NOTE: For long words/strings, you can pass a second argument to scale the results.
      Example: Soundex('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla interdum.',true);
      Returns: L6512534623532522336312252435453 // 32 chars long: ~~(length*2/3.5)

      To provide MySQL compatability, I've added a third argument:
      Example: Soundex('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla interdum.',true,true);
      Returns: L6512534623532523631252435453635 // 32 chars long, build length.
      MySQL:   SELECT SOUNDEX('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla interdum.'); 

Node.js:
   var Soundex = require('soundex');
   console.log('Euler: '+Soundex('Euler')+' - Ellery: '+Soundex('Ellery'));
   console.log('Hilbert: '+Soundex('Hilbert')+' - Heilbronn: '+Soundex('Heilbronn'));
   console.log('Lukasiewicz: '+Soundex('Lukasiewicz')+' - Lissajous: '+Soundex('Lissajous'));
   console.log('(default) Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla interdum.\n'+
             Soundex('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla interdum.',true));
   console.log('(MySQL) Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla interdum.\n'+
             Soundex('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla interdum.',true,true));

Browser:
   <script src="./soundex.js"></script>
   <script>
      alert('Euler: '+Soundex('Euler')+' - Ellery: '+Soundex('Ellery'));
      alert('Hilbert: '+Soundex('Hilbert')+' - Heilbronn: '+Soundex('Heilbronn'));
      alert('Lukasiewicz: '+Soundex('Lukasiewicz')+' - Lissajous: '+Soundex('Lissajous'));
      alert('(default) Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla interdum.\n'+
             Soundex('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla interdum.',true));
      alert('(MySQL) Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla interdum.\n'+
             Soundex('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla interdum.',true,true));
   </script>

node-soundex's People

Contributors

bitdeli-chef avatar louist avatar

Watchers

 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.