[postgis-tickets] [SCM] PostGIS branch master updated. 3.3.0rc2-1000-g8cebf5d6f
git at osgeo.org
git at osgeo.org
Thu Jun 22 19:56:49 PDT 2023
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".
The branch, master has been updated
via 8cebf5d6fc07e0dbfdb104a37ea5163dc1723877 (commit)
from 0583468045bf125e6248f271f04405f46a64664e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 8cebf5d6fc07e0dbfdb104a37ea5163dc1723877
Author: Regina Obe <lr at pcorp.us>
Date: Thu Jun 22 21:00:32 2023 -0400
CHANGES for debug_standardize_address
References #5397
- Add tests for debug_standardize_address
- Try to fix gitlab complaints
- Turn back on address_standardizer testing on winnie
- Fix postgis_tiger_geocoder regress not working. References #5254
- Turn back on winnie postgis_tiger_geocoder regression
(it's going to fail because of #5408)
diff --git a/ci/winnie/regress_postgis.sh b/ci/winnie/regress_postgis.sh
index 163eba6a1..682fe17bb 100644
--- a/ci/winnie/regress_postgis.sh
+++ b/ci/winnie/regress_postgis.sh
@@ -241,16 +241,15 @@ done
make check RUNTESTFLAGS="--extension -v"
-## TODO: Put back after folder into main check setup #5254
- ##test address standardizer
- #cd ${POSTGIS_SRC}
- #cd extensions/address_standardizer
- #make installcheck
-
- ##test tiger geocoder
- #cd ${POSTGIS_SRC}
- #cd extensions/postgis_tiger_geocoder
- #make installcheck
+ #test address standardizer
+ cd ${POSTGIS_SRC}
+ cd extensions/address_standardizer
+ make installcheck
+
+ #test tiger geocoder
+ cd ${POSTGIS_SRC}
+ cd extensions/postgis_tiger_geocoder
+ make installcheck
if [ "$?" != "0" ]; then
exit $?
fi
diff --git a/extensions/address_standardizer/Makefile.in b/extensions/address_standardizer/Makefile.in
index a13ca6358..8b07ad87e 100644
--- a/extensions/address_standardizer/Makefile.in
+++ b/extensions/address_standardizer/Makefile.in
@@ -50,15 +50,14 @@ DATA_built = \
all: sql/address_standardizer_pre.sql sql/address_standardizer.sql sql/address_standardizer--1.0--$(EXTVERSION).sql sql/$(EXTENSION)--$(EXTVERSION).sql sql/$(EXTENSION)--ANY--$(EXTVERSION).sql \
sql/$(EXTENSION)_data_us.sql sql/address_standardizer-- at POSTGIS_LIB_VERSION@.sql sql/$(EXTENSION)_data_us-- at POSTGIS_LIB_VERSION@.sql sql/$(EXTENSION)_data_us--$(EXTVERSION)--$(EXTVERSION)next.sql \
sql/$(EXTENSION)_data_us--$(EXTVERSION)next--$(EXTVERSION).sql sql/$(EXTENSION)_data_us--ANY--$(EXTVERSION).sql \
-sql/test-init-extensions.sql sql/test-parseaddress.sql sql/test-standardize_address_1.sql sql/test-standardize_address_2.sql
+sql/test-init-extensions.sql sql/test-parseaddress.sql sql/test-standardize_address_1.sql sql/test-standardize_address_2.sql sql/test-debug_standardize_address.sql
DOCS = README.address_standardizer
PG_CPPFLAGS = @CFLAGS@ @CPPFLAGS@ -DPCRE_VERSION=@PCRE_VERSION@
SHLIB_LINK = @SHLIB_LINK@ @PCRE_LDFLAGS@
EXTRA_CLEAN = sql/ usps-st-city-name.txt mk-st-regexp mk-city-regex test_main
-REGRESS = test-init-extensions test-parseaddress test-standardize_address_1 test-standardize_address_2
-
+REGRESS = test-init-extensions test-parseaddress test-standardize_address_1 test-standardize_address_2 test-debug_standardize_address
sql:
mkdir -p $@
diff --git a/extensions/address_standardizer/address_standardizer.c b/extensions/address_standardizer/address_standardizer.c
index 2a13d6406..a0a78f59f 100644
--- a/extensions/address_standardizer/address_standardizer.c
+++ b/extensions/address_standardizer/address_standardizer.c
@@ -151,9 +151,10 @@ debug_standardize_address(PG_FUNCTION_ARGS)
appendStringInfo(result, "%s", quote_identifier(macro));
appendStringInfoString(result, ",");
- std = GetStdUsingFCInfo(fcinfo, lextab, gaztab, rultab);
- if (!std)
- elog(ERROR, "%s failed to create the address standardizer object!", __func__);
+ std = GetStdUsingFCInfo(fcinfo, lextab, gaztab, rultab);
+ if (!std){
+ elog(ERROR, "%s failed to create the address standardizer object!", __func__);
+ }
elog(DEBUG2, "%s: calling std_standardize_mm('%s', '%s')", __func__ , micro, macro);
stdaddr = std_standardize_mm( std, micro, macro, 0 );
diff --git a/extensions/address_standardizer/expected/test-debug_standardize_address.out b/extensions/address_standardizer/expected/test-debug_standardize_address.out
new file mode 100644
index 000000000..31f312258
--- /dev/null
+++ b/extensions/address_standardizer/expected/test-debug_standardize_address.out
@@ -0,0 +1,39 @@
+SELECT je->>'pos' AS pos, je->>'input-word' AS input_word, je->>'input-token' AS input_token, je->>'mapped-word' AS ouput_word, je->>'output-token' AS output_token FROM jsonb(debug_standardize_address('us_lex'::text, 'us_gaz'::text, 'us_rules'::text, '123 Main Street'::text, 'Kansas City, MO 45678'::text)) AS d, jsonb_array_elements(d->'rules'->0->'rule_tokens' ) AS je;
+ pos | input_word | input_token | ouput_word | output_token
+-----+------------+-------------+------------+--------------
+ 0 | 123 | NUMBER | 123 | HOUSE
+ 1 | MAIN | WORD | MAIN | STREET
+ 2 | STREET | TYPE | STREET | SUFTYP
+(3 rows)
+
+SELECT jsonb_array_length(jsonb(d)->'rules') FROM debug_standardize_address('us_lex','us_gaz','us_rules', '10-20 DORRANCE ST PROVIDENCE RI') AS d;
+ jsonb_array_length
+--------------------
+ 6
+(1 row)
+
+SELECT '#5299a' AS ticket, jsonb_array_length(d->'rules') AS num_rules, jsonb_array_length(d->'input_tokens') AS num_input_tokens, d->'rules'->0->'raw_score' AS best_score FROM jsonb(debug_standardize_address('us_lex', 'us_gaz', 'us_rules','1 Timepiece Point','Boston, MA, 02220')) As d;
+ ticket | num_rules | num_input_tokens | best_score
+--------+-----------+------------------+------------
+ #5299a | 5 | 4 | 0.902500
+(1 row)
+
+SELECT '#2978c' As ticket, , jsonb_array_length(d->'rules') AS num_rules, jsonb_array_length(d->'input_tokens') AS num_input_tokens, d->'rules'->0->'raw_score' AS best_score FROM jsonb(debug_standardize_address('us_lex','us_gaz','us_rules', '10-20 DORRANCE ST, PROVIDENCE, RI')) AS d;
+ERROR: syntax error at or near ","
+LINE 1: SELECT '#2978c' As ticket, , jsonb_array_length(d->'rules') ...
+ ^
+SELECT '#5299b' AS ticket, jsonb_array_length(d->'rules') AS num_rules, jsonb_array_length(d->'input_tokens') AS num_input_tokens, d->'rules'->0->'score' AS best_score FROM jsonb(debug_standardize_address('us_lex', 'us_gaz', 'us_rules','50 Gold Piece Drive, Boston, MA, 02020')) AS d;
+ ticket | num_rules | num_input_tokens | best_score
+--------+-----------+------------------+------------
+ #5299b | 3 | 6 | 0.902500
+(1 row)
+
+SELECT '#5299bt' AS ticket, it->>'pos' AS pos, it->>'word' AS word, it->>'token' AS token, it->>'stdword' AS stdword FROM jsonb(debug_standardize_address('us_lex', 'us_gaz', 'us_rules','50 Gold Piece Drive, Boston, MA, 02020')) AS d, jsonb_array_elements(d->'input_tokens') AS it
+WHERE it @> '{"pos": 2}'::jsonb;
+ ticket | pos | word | token | stdword
+---------+-----+-------+-------+---------
+ #5299bt | 2 | PIECE | UNITH | PIECE
+ #5299bt | 2 | PIECE | UNITT | PIECE
+ #5299bt | 2 | PIECE | WORD | PIECE
+(3 rows)
+
diff --git a/extensions/address_standardizer/test-debug_standardize_address.sql.in b/extensions/address_standardizer/test-debug_standardize_address.sql.in
new file mode 100644
index 000000000..fc8f7fcbb
--- /dev/null
+++ b/extensions/address_standardizer/test-debug_standardize_address.sql.in
@@ -0,0 +1,11 @@
+SELECT je->>'pos' AS pos, je->>'input-word' AS input_word, je->>'input-token' AS input_token, je->>'mapped-word' AS ouput_word, je->>'output-token' AS output_token FROM jsonb(debug_standardize_address('us_lex'::text, 'us_gaz'::text, 'us_rules'::text, '123 Main Street'::text, 'Kansas City, MO 45678'::text)) AS d, jsonb_array_elements(d->'rules'->0->'rule_tokens' ) AS je;
+SELECT jsonb_array_length(jsonb(d)->'rules') FROM debug_standardize_address('us_lex','us_gaz','us_rules', '10-20 DORRANCE ST PROVIDENCE RI') AS d;
+
+SELECT '#5299a' AS ticket, jsonb_array_length(d->'rules') AS num_rules, jsonb_array_length(d->'input_tokens') AS num_input_tokens, d->'rules'->0->'raw_score' AS best_score FROM jsonb(debug_standardize_address('us_lex', 'us_gaz', 'us_rules','1 Timepiece Point','Boston, MA, 02220')) As d;
+
+SELECT '#2978c' As ticket, , jsonb_array_length(d->'rules') AS num_rules, jsonb_array_length(d->'input_tokens') AS num_input_tokens, d->'rules'->0->'raw_score' AS best_score FROM jsonb(debug_standardize_address('us_lex','us_gaz','us_rules', '10-20 DORRANCE ST, PROVIDENCE, RI')) AS d;
+
+SELECT '#5299b' AS ticket, jsonb_array_length(d->'rules') AS num_rules, jsonb_array_length(d->'input_tokens') AS num_input_tokens, d->'rules'->0->'score' AS best_score FROM jsonb(debug_standardize_address('us_lex', 'us_gaz', 'us_rules','50 Gold Piece Drive, Boston, MA, 02020')) AS d;
+
+SELECT '#5299bt' AS ticket, it->>'pos' AS pos, it->>'word' AS word, it->>'token' AS token, it->>'stdword' AS stdword FROM jsonb(debug_standardize_address('us_lex', 'us_gaz', 'us_rules','50 Gold Piece Drive, Boston, MA, 02020')) AS d, jsonb_array_elements(d->'input_tokens') AS it
+WHERE it @> '{"pos": 2}'::jsonb;
diff --git a/extensions/postgis_tiger_geocoder/Makefile.in b/extensions/postgis_tiger_geocoder/Makefile.in
index 8c7df1532..ed0fd3c08 100644
--- a/extensions/postgis_tiger_geocoder/Makefile.in
+++ b/extensions/postgis_tiger_geocoder/Makefile.in
@@ -63,7 +63,7 @@ sql/test-normalize_address.sql: sql_bits/test_tuples_only_unaligned.sql.in ../..
cat $^ > $@
sql/test-upgrade.sql: | sql
- echo 'ALTER EXTENSION ${EXTENSION} UPDATE TO "$(EXTVERSION)next"' > $@
+ echo 'ALTER EXTENSION ${EXTENSION} UPDATE TO "ANY"; ALTER EXTENSION ${EXTENSION} UPDATE TO "$(EXTVERSION)"' > $@
%.control: %.control.in Makefile
cat $< \
@@ -218,5 +218,4 @@ PERL=@PERL@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
-top_builddir = @top_builddir@
abs_topbuilddir=$(abspath $(top_builddir))
diff --git a/extensions/postgis_tiger_geocoder/regression.diffs b/extensions/postgis_tiger_geocoder/regression.diffs
new file mode 100644
index 000000000..fd98f21cb
--- /dev/null
+++ b/extensions/postgis_tiger_geocoder/regression.diffs
@@ -0,0 +1,12 @@
+diff -w -U3 C:/ming64gcc81/projects/postgis/postgis-git/extensions/postgis_tiger_geocoder/expected/test-pagc_normalize_address.out C:/ming64gcc81/projects/postgis/postgis-git/extensions/postgis_tiger_geocoder/results/test-pagc_normalize_address.out
+--- C:/ming64gcc81/projects/postgis/postgis-git/extensions/postgis_tiger_geocoder/expected/test-pagc_normalize_address.out 2023-06-22 22:01:47.690311400 -0400
++++ C:/ming64gcc81/projects/postgis/postgis-git/extensions/postgis_tiger_geocoder/results/test-pagc_normalize_address.out 2023-06-22 22:03:25.945667700 -0400
+@@ -4,7 +4,7 @@
+ #1051a|212||3RD|AVE|N|STE 560|MINNEAPOLIS|MN|55401|t||212
+ #1051b|3937||43RD|AVE|S||MINNEAPOLIS|MN|55406|t||3937
+ #1051c|212|N|3RD|AVE|||MINNEAPOLIS|MN|55401|t||212
+-#1051d|212||3RD|AVE|||MINNEAPOLIS|MN|N 55401|t||212
++#1051d|212||3RD|AVE|N||MINNEAPOLIS|MN|55401|t||212
+ 529||MAIN|ST|||BOSTON|MA|02129|t||529
+ 529||MAIN|ST|||BOSTON|MA|02129|t||529
+ 529||MAIN|ST|||BOSTON|MA||t||529
diff --git a/extensions/postgis_tiger_geocoder/regression.out b/extensions/postgis_tiger_geocoder/regression.out
new file mode 100644
index 000000000..9354390a6
--- /dev/null
+++ b/extensions/postgis_tiger_geocoder/regression.out
@@ -0,0 +1,8 @@
+# using postmaster on localhost, port 5453
+ok 1 - test-normalize_address 216 ms
+ok 2 - test-upgrade 456 ms
+not ok 3 + test-pagc_normalize_address 0 ms
+1..3
+# 1 of 3 tests failed.
+# The differences that caused some tests to fail can be viewed in the file "C:/ming64gcc81/projects/postgis/postgis-git/extensions/postgis_tiger_geocoder/regression.diffs".
+# A copy of the test summary that you see above is saved in the file "C:/ming64gcc81/projects/postgis/postgis-git/extensions/postgis_tiger_geocoder/regression.out".
-----------------------------------------------------------------------
Summary of changes:
ci/winnie/regress_postgis.sh | 19 +++++------
extensions/address_standardizer/Makefile.in | 5 ++-
.../address_standardizer/address_standardizer.c | 7 ++--
.../expected/test-debug_standardize_address.out | 39 ++++++++++++++++++++++
.../test-debug_standardize_address.sql.in | 11 ++++++
extensions/postgis_tiger_geocoder/Makefile.in | 3 +-
extensions/postgis_tiger_geocoder/regression.diffs | 12 +++++++
extensions/postgis_tiger_geocoder/regression.out | 8 +++++
8 files changed, 86 insertions(+), 18 deletions(-)
create mode 100644 extensions/address_standardizer/expected/test-debug_standardize_address.out
create mode 100644 extensions/address_standardizer/test-debug_standardize_address.sql.in
create mode 100644 extensions/postgis_tiger_geocoder/regression.diffs
create mode 100644 extensions/postgis_tiger_geocoder/regression.out
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list