Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
6141123a
Commit
6141123a
authored
Aug 11, 2017
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fuzzystrmatch: Add test suite
Reviewed-by:
David Steele
<
david@pgmasters.net
>
parent
b28dfa6d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
98 additions
and
4 deletions
+98
-4
contrib/fuzzystrmatch/.gitignore
contrib/fuzzystrmatch/.gitignore
+4
-0
contrib/fuzzystrmatch/Makefile
contrib/fuzzystrmatch/Makefile
+2
-0
contrib/fuzzystrmatch/expected/fuzzystrmatch.out
contrib/fuzzystrmatch/expected/fuzzystrmatch.out
+67
-0
contrib/fuzzystrmatch/sql/fuzzystrmatch.sql
contrib/fuzzystrmatch/sql/fuzzystrmatch.sql
+21
-0
doc/src/sgml/fuzzystrmatch.sgml
doc/src/sgml/fuzzystrmatch.sgml
+4
-4
No files found.
contrib/fuzzystrmatch/.gitignore
0 → 100644
View file @
6141123a
# Generated subdirectories
/log/
/results/
/tmp_check/
contrib/fuzzystrmatch/Makefile
View file @
6141123a
...
...
@@ -8,6 +8,8 @@ DATA = fuzzystrmatch--1.1.sql fuzzystrmatch--1.0--1.1.sql \
fuzzystrmatch--unpackaged--1.0.sql
PGFILEDESC
=
"fuzzystrmatch - similarities and distance between strings"
REGRESS
=
fuzzystrmatch
ifdef
USE_PGXS
PG_CONFIG
=
pg_config
PGXS
:=
$(
shell
$(PG_CONFIG)
--pgxs
)
...
...
contrib/fuzzystrmatch/expected/fuzzystrmatch.out
0 → 100644
View file @
6141123a
CREATE EXTENSION fuzzystrmatch;
SELECT soundex('hello world!');
soundex
---------
H464
(1 row)
SELECT soundex('Anne'), soundex('Ann'), difference('Anne', 'Ann');
soundex | soundex | difference
---------+---------+------------
A500 | A500 | 4
(1 row)
SELECT soundex('Anne'), soundex('Andrew'), difference('Anne', 'Andrew');
soundex | soundex | difference
---------+---------+------------
A500 | A536 | 2
(1 row)
SELECT soundex('Anne'), soundex('Margaret'), difference('Anne', 'Margaret');
soundex | soundex | difference
---------+---------+------------
A500 | M626 | 0
(1 row)
SELECT levenshtein('GUMBO', 'GAMBOL');
levenshtein
-------------
2
(1 row)
SELECT levenshtein('GUMBO', 'GAMBOL', 2, 1, 1);
levenshtein
-------------
3
(1 row)
SELECT levenshtein_less_equal('extensive', 'exhaustive', 2);
levenshtein_less_equal
------------------------
3
(1 row)
SELECT levenshtein_less_equal('extensive', 'exhaustive', 4);
levenshtein_less_equal
------------------------
4
(1 row)
SELECT metaphone('GUMBO', 4);
metaphone
-----------
KM
(1 row)
SELECT dmetaphone('gumbo');
dmetaphone
------------
KMP
(1 row)
SELECT dmetaphone_alt('gumbo');
dmetaphone_alt
----------------
KMP
(1 row)
contrib/fuzzystrmatch/sql/fuzzystrmatch.sql
0 → 100644
View file @
6141123a
CREATE
EXTENSION
fuzzystrmatch
;
SELECT
soundex
(
'hello world!'
);
SELECT
soundex
(
'Anne'
),
soundex
(
'Ann'
),
difference
(
'Anne'
,
'Ann'
);
SELECT
soundex
(
'Anne'
),
soundex
(
'Andrew'
),
difference
(
'Anne'
,
'Andrew'
);
SELECT
soundex
(
'Anne'
),
soundex
(
'Margaret'
),
difference
(
'Anne'
,
'Margaret'
);
SELECT
levenshtein
(
'GUMBO'
,
'GAMBOL'
);
SELECT
levenshtein
(
'GUMBO'
,
'GAMBOL'
,
2
,
1
,
1
);
SELECT
levenshtein_less_equal
(
'extensive'
,
'exhaustive'
,
2
);
SELECT
levenshtein_less_equal
(
'extensive'
,
'exhaustive'
,
4
);
SELECT
metaphone
(
'GUMBO'
,
4
);
SELECT
dmetaphone
(
'gumbo'
);
SELECT
dmetaphone_alt
(
'gumbo'
);
doc/src/sgml/fuzzystrmatch.sgml
View file @
6141123a
...
...
@@ -133,19 +133,19 @@ test=# SELECT levenshtein('GUMBO', 'GAMBOL');
2
(1 row)
test=# SELECT levenshtein('GUMBO', 'GAMBOL', 2,
1,
1);
test=# SELECT levenshtein('GUMBO', 'GAMBOL', 2,
1,
1);
levenshtein
-------------
3
(1 row)
test=# SELECT levenshtein_less_equal('extensive', 'exhaustive',2);
test=# SELECT levenshtein_less_equal('extensive', 'exhaustive',
2);
levenshtein_less_equal
------------------------
3
(1 row)
test=# SELECT levenshtein_less_equal('extensive', 'exhaustive',4);
test=# SELECT levenshtein_less_equal('extensive', 'exhaustive',
4);
levenshtein_less_equal
------------------------
4
...
...
@@ -227,7 +227,7 @@ dmetaphone_alt(text source) returns text
</para>
<screen>
test=#
select
dmetaphone('gumbo');
test=#
SELECT
dmetaphone('gumbo');
dmetaphone
------------
KMP
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment