Skip to content

pseudonym117/Levenshtein

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Levenshtein-steps

Levenshtein string difference in Javascript.

Screenshot

Levenshtein-steps also does some neat things like coerce to a number and string approproately. So you can compare Levenshtein objects directly! Not to mention it has specs!

Also it tells you the steps to get from one string to another.

API

  • new Levenshtein( m, n )Levenshtein

    • m ( String ): First string.
    • n ( String ): Second string.
    • Initialise a new Levenshtein object.
  • Levenshtein#distanceNumber

    • Distance between strings.
  • Levenshtein#inspect()String

    • Pretty print Levenshtein table.
  • Levenshtein#toString()String

    • Alias of: Levenshtein#inspect().
  • Levenshtein#valueOf()Number

    • Alias of: Levenshtein#distance.
  • Levenshtein#getSteps() -> Array[Array]

    • Returns list of the steps to get from string 1 to string 2
    • Steps in form of lists - ["operation", int_pos_str_1, int_pos_str_2]

Installation

Levenshtein works in both the browser and node.js.

Browser

Simply include levenshtein.js:

<script src="/javascripts/levenshtein.js"></script>

NPM

Install via npm:

npm install levenshtein-steps

Or put it in your package.json:

{ "levenshtein-steps": "*" }

Bower

bower install levenshtein-steps

Git

git clone git://github.com/pseudonym117/Levenshtein.git

License

Levenshtein-steps is UNLICENSED.

Author

Written by Gianni Chiappettagf3.ca

Forked and steps added by AG Stephan

About

Javascript implementation of the L-diggity.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%