2011-02-14 09:06:41 +08:00
|
|
|
/* contrib/fuzzystrmatch/fuzzystrmatch--1.0.sql */
|
2001-08-08 00:47:43 +08:00
|
|
|
|
2011-10-13 03:45:03 +08:00
|
|
|
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
|
|
|
|
\echo Use "CREATE EXTENSION fuzzystrmatch" to load this file. \quit
|
|
|
|
|
2011-02-14 10:24:14 +08:00
|
|
|
CREATE FUNCTION levenshtein (text,text) RETURNS int
|
2002-10-19 02:41:22 +08:00
|
|
|
AS 'MODULE_PATHNAME','levenshtein'
|
2005-01-26 16:04:04 +08:00
|
|
|
LANGUAGE C IMMUTABLE STRICT;
|
2002-10-19 02:41:22 +08:00
|
|
|
|
2011-02-14 10:24:14 +08:00
|
|
|
CREATE FUNCTION levenshtein (text,text,int,int,int) RETURNS int
|
2008-04-04 05:13:07 +08:00
|
|
|
AS 'MODULE_PATHNAME','levenshtein_with_costs'
|
|
|
|
LANGUAGE C IMMUTABLE STRICT;
|
|
|
|
|
2011-02-14 10:24:14 +08:00
|
|
|
CREATE FUNCTION levenshtein_less_equal (text,text,int) RETURNS int
|
2010-10-19 21:51:06 +08:00
|
|
|
AS 'MODULE_PATHNAME','levenshtein_less_equal'
|
|
|
|
LANGUAGE C IMMUTABLE STRICT;
|
|
|
|
|
2011-02-14 10:24:14 +08:00
|
|
|
CREATE FUNCTION levenshtein_less_equal (text,text,int,int,int,int) RETURNS int
|
2010-10-19 21:51:06 +08:00
|
|
|
AS 'MODULE_PATHNAME','levenshtein_less_equal_with_costs'
|
|
|
|
LANGUAGE C IMMUTABLE STRICT;
|
|
|
|
|
2011-02-14 10:24:14 +08:00
|
|
|
CREATE FUNCTION metaphone (text,int) RETURNS text
|
2002-10-19 02:41:22 +08:00
|
|
|
AS 'MODULE_PATHNAME','metaphone'
|
2005-01-26 16:04:04 +08:00
|
|
|
LANGUAGE C IMMUTABLE STRICT;
|
2001-08-08 02:16:01 +08:00
|
|
|
|
2011-02-14 10:24:14 +08:00
|
|
|
CREATE FUNCTION soundex(text) RETURNS text
|
2002-10-19 02:41:22 +08:00
|
|
|
AS 'MODULE_PATHNAME', 'soundex'
|
2005-01-26 16:04:04 +08:00
|
|
|
LANGUAGE C IMMUTABLE STRICT;
|
2001-08-08 02:16:01 +08:00
|
|
|
|
2011-02-14 10:24:14 +08:00
|
|
|
CREATE FUNCTION text_soundex(text) RETURNS text
|
2002-10-19 02:41:22 +08:00
|
|
|
AS 'MODULE_PATHNAME', 'soundex'
|
2005-01-26 16:04:04 +08:00
|
|
|
LANGUAGE C IMMUTABLE STRICT;
|
|
|
|
|
2011-02-14 10:24:14 +08:00
|
|
|
CREATE FUNCTION difference(text,text) RETURNS int
|
2005-01-26 16:04:04 +08:00
|
|
|
AS 'MODULE_PATHNAME', 'difference'
|
|
|
|
LANGUAGE C IMMUTABLE STRICT;
|
2004-07-01 11:25:48 +08:00
|
|
|
|
2011-02-14 10:24:14 +08:00
|
|
|
CREATE FUNCTION dmetaphone (text) RETURNS text
|
2005-01-26 16:04:04 +08:00
|
|
|
AS 'MODULE_PATHNAME', 'dmetaphone'
|
|
|
|
LANGUAGE C IMMUTABLE STRICT;
|
2004-07-01 11:25:48 +08:00
|
|
|
|
2011-02-14 10:24:14 +08:00
|
|
|
CREATE FUNCTION dmetaphone_alt (text) RETURNS text
|
2005-01-26 16:04:04 +08:00
|
|
|
AS 'MODULE_PATHNAME', 'dmetaphone_alt'
|
|
|
|
LANGUAGE C IMMUTABLE STRICT;
|