module Edits::RestrictedEdit
Overview
Implements Restricted Damerau-Levenshtein distance (Optimal Alignment) algorithm.
Determines distance between two strings by counting edits, identifying:
- Insertion
- Deletion
- Substitution
- Swapped items
Defined in:
edits/restricted_edit.crClass Method Summary
-
.distance(str1, str2)
Calculate the Restricted Damerau-Levenshtein distance (Optimal Alignment) of two sequences.
Class Method Detail
def self.distance(str1, str2)
#
Calculate the Restricted Damerau-Levenshtein distance (Optimal Alignment) of two sequences.
Note: Not a true distance metric, fails to satisfy triangle inequality.