X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/b18d042832bed3639314168fc64bf9928ef76fcd..299934fd2a1c5e481ed35c3b8df4f3fe38e32b68:/test/python/test_tokenizer_icu_rule_loader.py diff --git a/test/python/test_tokenizer_icu_rule_loader.py b/test/python/test_tokenizer_icu_rule_loader.py index 4671e0fe..e22ccd4b 100644 --- a/test/python/test_tokenizer_icu_rule_loader.py +++ b/test/python/test_tokenizer_icu_rule_loader.py @@ -122,6 +122,15 @@ def test_transliteration_rules_from_file(test_config): assert trans.transliterate(" axxt ") == " byt " +def test_search_rules(cfgrules): + config = cfgrules('~street => s,st', 'master => mstr') + proc = ICURuleLoader(config).make_token_analysis() + + assert proc.search.transliterate('Master Street').strip() == 'master street' + assert proc.search.transliterate('Earnes St').strip() == 'earnes st' + assert proc.search.transliterate('Nostreet').strip() == 'nostreet' + + class TestGetReplacements: @pytest.fixture(autouse=True)