From 55ba627c3cf6dc32a108b03d5b5f2c6880bfe8f8 Mon Sep 17 00:00:00 2001 From: Al Date: Fri, 8 Dec 2017 14:27:23 -0500 Subject: [PATCH] [similarity] needed to add utf8proc_category and invert the indices for counting transposes in affine gap --- src/string_similarity.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/string_similarity.c b/src/string_similarity.c index 806d28ea..953dbadd 100644 --- a/src/string_similarity.c +++ b/src/string_similarity.c @@ -184,7 +184,7 @@ affine_gap_edits_t affine_gap_distance_unicode_costs(uint32_array *u1_array, uin bool is_transpose = false; size_t w = c1 != c2 && !both_separators ? mismatch_cost : match_cost; - if (c1 != c2 && j < m && utf8_is_letter(c2) && utf8_is_letter(c1) && c2 == u1[j] && i < n && c1 == u2[i]) { + if (c1 != c2 && utf8_is_letter(utf8proc_category(c2)) && utf8_is_letter(utf8proc_category(c1)) && i < n && c2 == u1[i] && j < m && c1 == u2[j]) { w = transpose_cost; is_transpose = true; }