From 3aa8824a8c8de80bb02406f45b1dc530655086ff Mon Sep 17 00:00:00 2001 From: missinglink Date: Mon, 22 Jun 2020 13:37:50 +0200 Subject: [PATCH 1/5] Add Street Synonyms test cases --- test_cases/street_synonyms.json | 175 ++++++++++++++++++++++++++++++++ 1 file changed, 175 insertions(+) create mode 100644 test_cases/street_synonyms.json diff --git a/test_cases/street_synonyms.json b/test_cases/street_synonyms.json new file mode 100644 index 0000000..cd7b695 --- /dev/null +++ b/test_cases/street_synonyms.json @@ -0,0 +1,175 @@ +{ + "name": "street synonyms", + "priorityThresh": 1, + "normalizers": { + "street": [ + "toLowerCase", + "abbreviateDirectionals" + ] + }, + "tests": [ + { + "id": 1.1, + "status": "pass", + "user": "missinglink", + "notes": ["R == Rue"], + "in": { + "text": "R Gay Lussac, Paris" + }, + "expected": { + "properties": [ + { "street": "Rue Gay-Lussac" } + ] + } + }, + { + "id": 1.2, + "status": "pass", + "user": "missinglink", + "notes": ["Rue == Rue"], + "in": { + "text": "Rue Gay Lussac, Paris" + }, + "expected": { + "properties": [ + { + "street": "Rue Gay-Lussac" + } + ] + } + }, + { + "id": 2.1, + "status": "pass", + "user": "missinglink", + "notes": ["Av. == Avenida"], + "in": { + "text": "Av. Juárez, Guadalajara, México" + }, + "expected": { + "properties": [ + { "street": "Avenida Juárez" } + ] + } + }, + { + "id": 2.2, + "status": "pass", + "user": "missinglink", + "notes": ["Avenida == Avenida"], + "in": { + "text": "Avenida Juárez, Guadalajara, México" + }, + "expected": { + "properties": [ + { + "street": "Avenida Juárez" + } + ] + } + }, + { + "id": 2.3, + "status": "pass", + "user": "missinglink", + "notes": ["Avenue != Avenida"], + "in": { + "text": "Avenue Juárez, Guadalajara, México" + }, + "unexpected": { + "properties": [ + { + "street": "Avenida Juárez" + } + ] + } + }, + { + "id": 3.1, + "status": "pass", + "user": "missinglink", + "notes": ["St == Saint && St == Street"], + "in": { + "text": "St Patrick St, Donaldsonville, LA" + }, + "expected": { + "properties": [ + { "street": "Saint Patrick Street" } + ] + } + }, + { + "id": 3.2, + "status": "pass", + "user": "missinglink", + "notes": ["Sainte != Saint && St == Street"], + "in": { + "text": "Sainte Patrick St, Donaldsonville, LA" + }, + "unexpected": { + "properties": [ + { "street": "Saint Patrick Street" } + ] + } + }, + { + "id": 3.3, + "status": "pass", + "user": "missinglink", + "notes": ["St == Saint && Straße != Street"], + "in": { + "text": "St Patrick Straße, Donaldsonville, LA" + }, + "unexpected": { + "properties": [ + { "street": "Saint Patrick Street" } + ] + } + }, + { + "id": 4.1, + "status": "pass", + "user": "missinglink", + "in": { + "text": "W Mt Hope Av. MI USA" + }, + "expected": { + "properties": [ + { + "street": "West Mount Hope Avenue" + } + ] + } + }, + { + "id": 4.2, + "status": "pass", + "user": "missinglink", + "in": { + "text": "West Mount Hope Avenue MI USA" + }, + "expected": { + "properties": [ + { + "street": "West Mount Hope Avenue" + } + ] + } + }, + { + "id": 5, + "status": "pass", + "user": "missinglink", + "in": { + "text": "E 98th Ter, MO, USA" + }, + "expected": { + "properties": [ + { + "street": "East 98th Terrace" + } + ] + } + } + ] +} From b9a03b3324b6e1c35c0e25772d259d8cbb75738d Mon Sep 17 00:00:00 2001 From: Julian Simioni Date: Mon, 22 Jun 2020 12:41:10 -0700 Subject: [PATCH 2/5] Use workaround for normalizer issue Connects https://github.com/pelias/fuzzy-tester/issues/201 --- test_cases/street_synonyms.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test_cases/street_synonyms.json b/test_cases/street_synonyms.json index cd7b695..b8159a0 100644 --- a/test_cases/street_synonyms.json +++ b/test_cases/street_synonyms.json @@ -3,8 +3,9 @@ "priorityThresh": 1, "normalizers": { "street": [ - "toLowerCase", - "abbreviateDirectionals" + "toUpperCase", + "abbreviateDirectionals", + "toLowerCase" ] }, "tests": [ From 42c5155a46238daaa210c773539076e4aa840159 Mon Sep 17 00:00:00 2001 From: Julian Simioni Date: Thu, 25 Jun 2020 08:22:03 -0700 Subject: [PATCH 3/5] Lower search abbreviations priorityThresh to 1 --- test_cases/search_abbreviations.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_cases/search_abbreviations.json b/test_cases/search_abbreviations.json index bcd56c0..44463da 100644 --- a/test_cases/search_abbreviations.json +++ b/test_cases/search_abbreviations.json @@ -1,6 +1,6 @@ { "name": "search abbreviations", - "priorityThresh": 5, + "priorityThresh": 1, "tests": [ { "id": 1, From 9363518642b35c97a26a04962743d1c73680ee42 Mon Sep 17 00:00:00 2001 From: Julian Simioni Date: Thu, 25 Jun 2020 08:25:34 -0700 Subject: [PATCH 4/5] Combine street synonym tests into search abbreviations suite These are very similar, there's no need for a new test suite --- test_cases/search_abbreviations.json | 151 ++++++++++++++++++++++- test_cases/street_synonyms.json | 176 --------------------------- 2 files changed, 150 insertions(+), 177 deletions(-) delete mode 100644 test_cases/street_synonyms.json diff --git a/test_cases/search_abbreviations.json b/test_cases/search_abbreviations.json index 44463da..6bccda1 100644 --- a/test_cases/search_abbreviations.json +++ b/test_cases/search_abbreviations.json @@ -24,7 +24,7 @@ } }, { - "id": 2, + "id": 1.1, "status": "fail", "user": "julian", "issue": "https://github.com/pelias/pelias/issues/737", @@ -44,6 +44,34 @@ ] } }, + { + "id": 1.3, + "status": "pass", + "user": "missinglink", + "notes": ["Sainte != Saint && St == Street"], + "in": { + "text": "Sainte Patrick St, Donaldsonville, LA" + }, + "unexpected": { + "properties": [ + { "street": "Saint Patrick Street" } + ] + } + }, + { + "id": 1.4, + "status": "pass", + "user": "missinglink", + "notes": ["St == Saint && Straße != Street"], + "in": { + "text": "St Patrick Straße, Donaldsonville, LA" + }, + "unexpected": { + "properties": [ + { "street": "Saint Patrick Street" } + ] + } + }, { "id": 3, "status": "pass", @@ -108,6 +136,127 @@ } ] } + }, + { + "id": 6.1, + "status": "pass", + "user": "missinglink", + "notes": ["R == Rue"], + "in": { + "text": "R Gay Lussac, Paris" + }, + "expected": { + "properties": [ + { "street": "Rue Gay-Lussac" } + ] + } + }, + { + "id": 6.2, + "status": "pass", + "user": "missinglink", + "notes": ["Rue == Rue"], + "in": { + "text": "Rue Gay Lussac, Paris" + }, + "expected": { + "properties": [ + { + "street": "Rue Gay-Lussac" + } + ] + } + }, + { + "id": 7.1, + "status": "pass", + "user": "missinglink", + "notes": ["Av. == Avenida"], + "in": { + "text": "Av. Juárez, Guadalajara, México" + }, + "expected": { + "properties": [ + { "street": "Avenida Juárez" } + ] + } + }, + { + "id": 7.2, + "status": "pass", + "user": "missinglink", + "notes": ["Avenida == Avenida"], + "in": { + "text": "Avenida Juárez, Guadalajara, México" + }, + "expected": { + "properties": [ + { + "street": "Avenida Juárez" + } + ] + } + }, + { + "id": 7.3, + "status": "pass", + "user": "missinglink", + "notes": ["Avenue != Avenida"], + "in": { + "text": "Avenue Juárez, Guadalajara, México" + }, + "unexpected": { + "properties": [ + { + "street": "Avenida Juárez" + } + ] + } + }, + { + "id": 8.1, + "status": "pass", + "user": "missinglink", + "in": { + "text": "W Mt Hope Av. MI USA" + }, + "expected": { + "properties": [ + { + "street": "West Mount Hope Avenue" + } + ] + } + }, + { + "id": 8.2, + "status": "pass", + "user": "missinglink", + "in": { + "text": "West Mount Hope Avenue MI USA" + }, + "expected": { + "properties": [ + { + "street": "West Mount Hope Avenue" + } + ] + } + }, + { + "id": 9, + "status": "pass", + "user": "missinglink", + "in": { + "text": "E 98th Ter, MO, USA" + }, + "expected": { + "properties": [ + { + "street": "East 98th Terrace" + } + ] + } } ] } diff --git a/test_cases/street_synonyms.json b/test_cases/street_synonyms.json deleted file mode 100644 index b8159a0..0000000 --- a/test_cases/street_synonyms.json +++ /dev/null @@ -1,176 +0,0 @@ -{ - "name": "street synonyms", - "priorityThresh": 1, - "normalizers": { - "street": [ - "toUpperCase", - "abbreviateDirectionals", - "toLowerCase" - ] - }, - "tests": [ - { - "id": 1.1, - "status": "pass", - "user": "missinglink", - "notes": ["R == Rue"], - "in": { - "text": "R Gay Lussac, Paris" - }, - "expected": { - "properties": [ - { "street": "Rue Gay-Lussac" } - ] - } - }, - { - "id": 1.2, - "status": "pass", - "user": "missinglink", - "notes": ["Rue == Rue"], - "in": { - "text": "Rue Gay Lussac, Paris" - }, - "expected": { - "properties": [ - { - "street": "Rue Gay-Lussac" - } - ] - } - }, - { - "id": 2.1, - "status": "pass", - "user": "missinglink", - "notes": ["Av. == Avenida"], - "in": { - "text": "Av. Juárez, Guadalajara, México" - }, - "expected": { - "properties": [ - { "street": "Avenida Juárez" } - ] - } - }, - { - "id": 2.2, - "status": "pass", - "user": "missinglink", - "notes": ["Avenida == Avenida"], - "in": { - "text": "Avenida Juárez, Guadalajara, México" - }, - "expected": { - "properties": [ - { - "street": "Avenida Juárez" - } - ] - } - }, - { - "id": 2.3, - "status": "pass", - "user": "missinglink", - "notes": ["Avenue != Avenida"], - "in": { - "text": "Avenue Juárez, Guadalajara, México" - }, - "unexpected": { - "properties": [ - { - "street": "Avenida Juárez" - } - ] - } - }, - { - "id": 3.1, - "status": "pass", - "user": "missinglink", - "notes": ["St == Saint && St == Street"], - "in": { - "text": "St Patrick St, Donaldsonville, LA" - }, - "expected": { - "properties": [ - { "street": "Saint Patrick Street" } - ] - } - }, - { - "id": 3.2, - "status": "pass", - "user": "missinglink", - "notes": ["Sainte != Saint && St == Street"], - "in": { - "text": "Sainte Patrick St, Donaldsonville, LA" - }, - "unexpected": { - "properties": [ - { "street": "Saint Patrick Street" } - ] - } - }, - { - "id": 3.3, - "status": "pass", - "user": "missinglink", - "notes": ["St == Saint && Straße != Street"], - "in": { - "text": "St Patrick Straße, Donaldsonville, LA" - }, - "unexpected": { - "properties": [ - { "street": "Saint Patrick Street" } - ] - } - }, - { - "id": 4.1, - "status": "pass", - "user": "missinglink", - "in": { - "text": "W Mt Hope Av. MI USA" - }, - "expected": { - "properties": [ - { - "street": "West Mount Hope Avenue" - } - ] - } - }, - { - "id": 4.2, - "status": "pass", - "user": "missinglink", - "in": { - "text": "West Mount Hope Avenue MI USA" - }, - "expected": { - "properties": [ - { - "street": "West Mount Hope Avenue" - } - ] - } - }, - { - "id": 5, - "status": "pass", - "user": "missinglink", - "in": { - "text": "E 98th Ter, MO, USA" - }, - "expected": { - "properties": [ - { - "street": "East 98th Terrace" - } - ] - } - } - ] -} From f8f3bafb9f2e84bf77fb0c7b2400fd426f1a9af2 Mon Sep 17 00:00:00 2001 From: Julian Simioni Date: Thu, 25 Jun 2020 08:26:46 -0700 Subject: [PATCH 5/5] Mark abbreviation tests failing Most of these should be fixed by https://github.com/pelias/schema/pull/453 --- test_cases/search_abbreviations.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test_cases/search_abbreviations.json b/test_cases/search_abbreviations.json index 6bccda1..0441c4f 100644 --- a/test_cases/search_abbreviations.json +++ b/test_cases/search_abbreviations.json @@ -139,7 +139,7 @@ }, { "id": 6.1, - "status": "pass", + "status": "fail", "user": "missinglink", "notes": ["R == Rue"], "in": { @@ -169,7 +169,7 @@ }, { "id": 7.1, - "status": "pass", + "status": "fail", "user": "missinglink", "notes": ["Av. == Avenida"], "in": { @@ -215,7 +215,7 @@ }, { "id": 8.1, - "status": "pass", + "status": "fail", "user": "missinglink", "in": { "text": "W Mt Hope Av. MI USA" @@ -245,7 +245,7 @@ }, { "id": 9, - "status": "pass", + "status": "fail", "user": "missinglink", "in": { "text": "E 98th Ter, MO, USA"