org.basex.util
Class Levenshtein

java.lang.Object
  extended by org.basex.util.Levenshtein

public final class Levenshtein
extends Object

Levenshtein implementation, based on "Levenshtein [1965], Binary codes capable of correcting spurious insertions and deletions of ones".

Author:
Workgroup DBIS, University of Konstanz 2005-10, ISC License, Christian Gruen

Constructor Summary
Levenshtein()
          Constructor.
 
Method Summary
 boolean similar(byte[] token, byte[] sub, int err)
          Compares two character arrays for similarity.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Levenshtein

public Levenshtein()
Constructor.

Method Detail

similar

public boolean similar(byte[] token,
                       byte[] sub,
                       int err)
Compares two character arrays for similarity.

Parameters:
token - token to be compared
sub - second token to be compared
err - number of allowed errors; dynamic calculation if value is 0
Returns:
true if the arrays are similar