This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static inline int levenshtein_dist(const int depth, const char p, const char c, const unsigned char* term, const int term_len, | |
const int* irow, const int* jrow, int* krow) | |
{ | |
int row_min = std::numeric_limits<int>::max(); | |
const int columns = term_len+1; | |
krow[0] = jrow[0] + 1; | |
// Calculate levenshtein distance incrementally (j => column, b => term): | |
// https://en.wikipedia.org/wiki/Damerau%E2%80%93Levenshtein_distance#Optimal_string_alignment_distance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2001|1|www.badshop.com|electronics|Electronics Something Four|DDDDDD|green|M11 | |
2002|2|www.goodshop.com|electronics|Electronics Something Five|PPPP|yellow|F22 | |
2003|3|www.badshop.com|electronics|Electronics Something Six|AAAAA|orange|U33 | |
2004|4|www.goodshop.com|electronics|Electronics Something Seven|BBBBB|red|M11 | |
2005|5|www.badshop.com|electronics|Electronics Something Eight|CCCC|violet|F22 | |
2006|6|www.goodshop.com|electronics|Electronics Something Nine|DDDDDD|indigo|U33 | |
2007|7|www.badshop.com|electronics|Electronics Something Ten|PPPP|blue|M11 | |
2008|8|www.goodshop.com|electronics|Electronics Something One|AAAAA|green|F22 | |
2009|9|www.badshop.com|electronics|Electronics Something Two|BBBBB|yellow|U33 | |
2010|10|www.goodshop.com|electronics|Electronics Something Three|CCCC|orange|M11 |