X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/9ff4f66f5555cc812c0e8f10ef007cdeae3b9836..b9fbfeff67b420905a4176f4f5e9312746d0c42e:/test/python/test_tokenizer_legacy_icu.py?ds=sidebyside diff --git a/test/python/test_tokenizer_legacy_icu.py b/test/python/test_tokenizer_legacy_icu.py index b687d0e4..39fc9fb4 100644 --- a/test/python/test_tokenizer_legacy_icu.py +++ b/test/python/test_tokenizer_legacy_icu.py @@ -60,13 +60,12 @@ def analyzer(tokenizer_factory, test_config, monkeypatch, monkeypatch.undo() def _mk_analyser(norm=("[[:Punctuation:][:Space:]]+ > ' '",), trans=(':: upper()',), - suffixes=('gasse', ), abbr=('street => st', )): + variants=('~gasse -> gasse', 'street => st', )): cfgfile = tmp_path / 'analyser_test_config.yaml' with cfgfile.open('w') as stream: cfgstr = {'normalization' : list(norm), 'transliteration' : list(trans), - 'compound_suffixes' : list(suffixes), - 'abbreviations' : list(abbr)} + 'variants' : [ {'words': list(variants)}]} yaml.dump(cfgstr, stream) tok.naming_rules = ICUNameProcessorRules(loader=ICURuleLoader(cfgfile)) @@ -151,7 +150,7 @@ def test_init_word_table(tokenizer_factory, test_config, place_row, word_table): tok = tokenizer_factory() tok.init_new_db(test_config) - assert word_table.get_partial_words() == {('te', 1), ('st', 1), ('52', 1), + assert word_table.get_partial_words() == {('test', 1), ('no', 1), ('area', 2), ('holz', 1), ('strasse', 1), ('str', 1)}