]> git.openstreetmap.org Git - nominatim.git/blobdiff - test/python/test_tokenizer_legacy_icu.py
switch to a more flexible variant description format
[nominatim.git] / test / python / test_tokenizer_legacy_icu.py
index b86925ee5dd22b134bd66b7419db8b7c7b45f9d1..56c08e5aa11b5d623bb21daafea291e8e6f8f133 100644 (file)
@@ -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))