26#define MAX_LEVENSHTEIN_STRLEN 255
67#ifdef LEVENSHTEIN_LESS_EQUAL
69 const char *target,
int tlen,
71 int max_d,
bool trusted)
74 const char *target,
int tlen,
92#ifdef LEVENSHTEIN_LESS_EQUAL
98#define START_COLUMN start_column
99#define STOP_COLUMN stop_column
103#define START_COLUMN 0
132 errmsg(
"levenshtein argument exceeds maximum length of %d characters",
135#ifdef LEVENSHTEIN_LESS_EQUAL
199 for (
i = 0;
i < m; ++
i)
212 prev = (
int *)
palloc(2 * m *
sizeof(
int));
223 for (
y = target,
j = 1;
j < n;
j++)
230#ifdef LEVENSHTEIN_LESS_EQUAL
294 sub = prev[
i - 1] +
sub_c;
315 sub = prev[
i - 1] + ((*
x == *
y) ? 0 :
sub_c);
334#ifdef LEVENSHTEIN_LESS_EQUAL
353 int zp =
j - (n - m);
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define MAX_LEVENSHTEIN_STRLEN
int varstr_levenshtein(const char *source, int slen, const char *target, int tlen, int ins_c, int del_c, int sub_c, bool trusted)
int pg_mbstrlen_with_len(const char *mbstr, int limit)
int pg_mblen(const char *mbstr)
static rewind_source * source
static bool rest_of_char_same(const char *s1, const char *s2, int len)
int varstr_levenshtein_less_equal(const char *source, int slen, const char *target, int tlen, int ins_c, int del_c, int sub_c, int max_d, bool trusted)