module

Difftance::EditDistance

Instance methods

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

Wagner–Fischer algorithm

Source
edit_distance(before before_str : String, after after_str : String, costs = {deletion: 1, insertion: 1, substitution: 1}, no_substitution = false)
Source
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)

Source