module Difftance::EditDistance

Extended Modules

Defined in:

difftance/edit_distance.cr

Instance Method Summary

Instance Method Detail

def dp(before before_str : String, after after_str : String, costs = {deletion: 1, insertion: 1, substitution: 1}) #

Wagner–Fischer algorithm


[View source]
def edit_distance(before before_str : String, after after_str : String, costs = {deletion: 1, insertion: 1, substitution: 1}, no_substitution = false) #

[View source]
def edit_distance_no_substitution(before before_str : String, after after_str : String, costs = {deletion: 1, insertion: 1}) #

Wu, S., Manber, U., Myers, E.W., & Miller, W. (1990). An O(NP) Sequence Comparison Algorithm. Inf. Process. Lett., 35, 317-323. https://api.semanticscholar.org/CorpusID:9968782 ins=1, del=1, sub=2(disallowing substitution)


[View source]