Skip to content

Commit a290378

Browse files
committed
Add support for Daitch-Mokotoff Soundex in contrib/fuzzystrmatch.
This modernized version of Soundex works significantly better than the original, particularly for non-English names. Dag Lem, reviewed by quite a few people along the way Discussion: https://postgr.es/m/[email protected]
1 parent 728015a commit a290378

13 files changed

+1315
-11
lines changed

contrib/fuzzystrmatch/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Generated files
2+
/daitch_mokotoff.h
13
# Generated subdirectories
24
/log/
35
/results/

contrib/fuzzystrmatch/Makefile

+18-2
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,17 @@
33
MODULE_big = fuzzystrmatch
44
OBJS = \
55
$(WIN32RES) \
6+
daitch_mokotoff.o \
67
dmetaphone.o \
78
fuzzystrmatch.o
89

910
EXTENSION = fuzzystrmatch
10-
DATA = fuzzystrmatch--1.1.sql fuzzystrmatch--1.0--1.1.sql
11+
DATA = fuzzystrmatch--1.1.sql fuzzystrmatch--1.1--1.2.sql \
12+
fuzzystrmatch--1.0--1.1.sql
13+
1114
PGFILEDESC = "fuzzystrmatch - similarities and distance between strings"
1215

13-
REGRESS = fuzzystrmatch
16+
REGRESS = fuzzystrmatch fuzzystrmatch_utf8
1417

1518
ifdef USE_PGXS
1619
PG_CONFIG = pg_config
@@ -22,3 +25,16 @@ top_builddir = ../..
2225
include $(top_builddir)/src/Makefile.global
2326
include $(top_srcdir)/contrib/contrib-global.mk
2427
endif
28+
29+
# Force this dependency to be known even without dependency info built:
30+
daitch_mokotoff.o: daitch_mokotoff.h
31+
32+
daitch_mokotoff.h: daitch_mokotoff_header.pl
33+
$(PERL) $< $@
34+
35+
# daitch_mokotoff.h is included in tarballs, so it has to be made by
36+
# "distprep" and not cleaned except by "maintainer-clean".
37+
distprep: daitch_mokotoff.h
38+
39+
maintainer-clean:
40+
rm -f daitch_mokotoff.h

0 commit comments

Comments
 (0)