From 4d61cc87cff9ecf5c90741a94c4b93da2f12c5ad Mon Sep 17 00:00:00 2001 From: miku0 Date: Mon, 31 Jul 2023 02:39:56 +0000 Subject: [PATCH] Add the test of reconbine_place --- .../tokenizer/sanitizers/test_tag_japanese.py | 49 +++++++++++++------ 1 file changed, 34 insertions(+), 15 deletions(-) diff --git a/test/python/tokenizer/sanitizers/test_tag_japanese.py b/test/python/tokenizer/sanitizers/test_tag_japanese.py index c82c4261..2f5e442c 100644 --- a/test/python/tokenizer/sanitizers/test_tag_japanese.py +++ b/test/python/tokenizer/sanitizers/test_tag_japanese.py @@ -31,12 +31,10 @@ class TestTagJapanese: res = self.run_sanitizer_on('address', block_number='6') assert res == [('6','housenumber')] - #def test_neighbourhood(self): - # res = self.run_sanitizer_on('address',neighbourhood='8丁目') - # assert res == [('8','place')] def test_neighbourhood(self): res = self.run_sanitizer_on('address', neighbourhood='8') assert res == [('8','place')] + def test_quarter(self): res = self.run_sanitizer_on('address', quarter='kase') assert res==[('kase','place')] @@ -45,21 +43,42 @@ class TestTagJapanese: res = self.run_sanitizer_on('address', housenumber='2', block_number='6') assert res == [('6-2','housenumber')] - def test_housenumber_blocknumber(self): - res = self.run_sanitizer_on('address', housenumber='2', neighbourhood='8') - assert res == [('2','housenumber'),('8','place')] + def test_quarter_neighbourhood(self): + res = self.run_sanitizer_on('address', quarter='kase', neighbourhood='8') + assert res == [('kase8','place')] - def test_housenumber_blocknumber(self): - res = self.run_sanitizer_on('address', block_number='6', neighbourhood='8') - assert res == [('6','housenumber'),('8','place')] + def test_blocknumber_housenumber_quarter(self): + res = self.run_sanitizer_on('address', block_number='6', housenumber='2', quarter='kase') + assert res == [('6-2','housenumber'),('kase','place')] - def test_housenumber_blocknumber_neighbourhood(self): - res = self.run_sanitizer_on('address', housenumber='2', block_number='6', neighbourhood='8') + def test_blocknumber_housenumber_quarter_neighbourhood(self): + res = self.run_sanitizer_on('address', block_number='6', housenumber='2', neighbourhood='8') assert res == [('6-2','housenumber'),('8','place')] + def test_blocknumber_quarter_neighbourhood(self): + res = self.run_sanitizer_on('address',block_number='6', quarter='kase', neighbourhood='8') + assert res == [('6','housenumber'),('kase8','place')] + + def test_blocknumber_quarter(self): + res = self.run_sanitizer_on('address',block_number='6', quarter='kase') + assert res == [('6','housenumber'),('kase','place')] + + def test_blocknumber_neighbourhood(self): + res = self.run_sanitizer_on('address',block_number='6', neighbourhood='8') + assert res == [('6','housenumber'),('8','place')] + + def test_housenumber_quarter_neighbourhood(self): + res = self.run_sanitizer_on('address',housenumber='2', quarter='kase', neighbourhood='8') + assert res == [('2','housenumber'),('kase8','place')] + + def test_housenumber_quarter(self): + res = self.run_sanitizer_on('address',housenumber='2', quarter='kase') + assert res == [('2','housenumber'),('kase','place')] + def test_housenumber_blocknumber_neighbourhood_quarter(self): - res = self.run_sanitizer_on('address', housenumber='2', block_number='6', neighbourhood='8',quarter='kase') + res = self.run_sanitizer_on('address', block_number='6', housenumber='2', quarter='kase', neighbourhood='8') + assert res == [('6-2','housenumber'),('kase8','place')] + + def test_KANJI_MAP(self): + res = self.run_sanitizer_on('address', block_number='六', housenumber='二', quarter='kase', neighbourhood='八') assert res == [('6-2','housenumber'),('kase8','place')] - def test_neighbourhood_quarter(self): - res = self.run_sanitizer_on('address', neighbourhood='8',quarter='kase') - assert res == [('kase8','place')] -- 2.39.5