X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/c35b3ea5c7125dc874557d121cb3e97b84a498b2..f960a9bf7fd1702b3d66995dd69307bd91d61a08:/test/python/tokenizer/token_analysis/test_generic_mutation.py?ds=sidebyside diff --git a/test/python/tokenizer/token_analysis/test_generic_mutation.py b/test/python/tokenizer/token_analysis/test_generic_mutation.py index abe31f6d..7d0db925 100644 --- a/test/python/tokenizer/token_analysis/test_generic_mutation.py +++ b/test/python/tokenizer/token_analysis/test_generic_mutation.py @@ -1,8 +1,8 @@ -# SPDX-License-Identifier: GPL-2.0-only +# SPDX-License-Identifier: GPL-3.0-or-later # # This file is part of Nominatim. (https://nominatim.org) # -# Copyright (C) 2022 by the Nominatim developer community. +# Copyright (C) 2024 by the Nominatim developer community. # For a full list of authors see the git log. """ Tests for generic token analysis, mutation part. @@ -11,8 +11,8 @@ import pytest from icu import Transliterator -import nominatim.tokenizer.token_analysis.generic as module -from nominatim.errors import UsageError +import nominatim_db.tokenizer.token_analysis.generic as module +from nominatim_db.errors import UsageError DEFAULT_NORMALIZATION = """ '🜳' > ' '; [[:Nonspacing Mark:] [:Cf:]] >; @@ -31,16 +31,16 @@ class TestMutationNoVariants: 'mutations': [ {'pattern': m[0], 'replacements': m[1]} for m in mutations] } - config = module.configure(rules, DEFAULT_NORMALIZATION) trans = Transliterator.createFromRules("test_trans", DEFAULT_TRANSLITERATION) norm = Transliterator.createFromRules("test_norm", DEFAULT_NORMALIZATION) + config = module.configure(rules, norm, trans) self.analysis = module.create(norm, trans, config) def variants(self, name): norm = Transliterator.createFromRules("test_norm", DEFAULT_NORMALIZATION) - return set(self.analysis.get_variants_ascii(norm.transliterate(name).strip())) + return set(self.analysis.compute_variants(norm.transliterate(name).strip())) @pytest.mark.parametrize('pattern', ('(capture)', ['a list']))