From b0ddff4f0d56a877305649a14b902b3f23140b4b Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 13 Jul 2011 19:39:37 +0400 Subject: * Add new algorithm based on diff algorithm to compare relatively short text parts --- src/lua/lua_task.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/lua/lua_task.c') diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index 4916a50ad..f217ee0b2 100644 --- a/src/lua/lua_task.c +++ b/src/lua/lua_task.c @@ -37,6 +37,7 @@ #include "../classifiers/classifiers.h" #include "../binlog.h" #include "../statfile_sync.h" +#include "../diff.h" extern stat_file_t* get_statfile_by_symbol (statfile_pool_t *pool, struct classifier_config *ccf, const gchar *symbol, struct statfile **st, gboolean try_create); @@ -1368,7 +1369,12 @@ lua_textpart_compare_distance (lua_State * L) } else { if (!part->is_empty && !other->is_empty) { - diff = fuzzy_compare_parts (part, other); + if (part->diff_str != NULL && other->diff_str != NULL) { + diff = compare_diff_distance (part->diff_str, other->diff_str); + } + else { + diff = fuzzy_compare_parts (part, other); + } } else if ((part->is_empty && !other->is_empty) || (!part->is_empty && other->is_empty)) { /* Empty and non empty parts are different */ -- cgit v1.2.3