LevenshteinAutomata

class LevenshteinAutomata(val word: IntArray, val alphaMax: Int, withTranspositions: Boolean)

Class to construct DFAs that match a word within some edit distance.

Implements the algorithm described in: Schulz and Mihov: Fast String Correction with Levenshtein Automata

Constructors

Link copied to clipboard
constructor(word: IntArray, alphaMax: Int, withTranspositions: Boolean)
constructor(input: String, withTranspositions: Boolean)

Create a new LevenshteinAutomata for some input String. Optionally count transpositions as a primitive edit.

Types

Link copied to clipboard
object Companion
Link copied to clipboard
abstract class ParametricDescription(w: Int, n: Int, minErrors: IntArray)

A ParametricDescription describes the structure of a Levenshtein DFA for some degree n.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun getVector(x: Int, pos: Int, end: Int): Int

Get the characteristic vector X(x, V) where V is substring(pos, end)

Link copied to clipboard

Compute a DFA that accepts all strings within an edit distance of n.

fun toAutomaton(n: Int, prefix: String): Automaton?

Compute a DFA that accepts all strings within an edit distance of n, matching the specified exact prefix.