1 # SPDX-License-Identifier: GPL-3.0-or-later
3 # This file is part of Nominatim. (https://nominatim.org)
5 # Copyright (C) 2025 by the Nominatim developer community.
6 # For a full list of authors see the git log.
8 Tests for japanese phrase splitting.
12 import nominatim_api.search.query as qmod
13 from nominatim_api.query_preprocessing.config import QueryConfig
14 from nominatim_api.query_preprocessing import split_japanese_phrases
17 def run_preprocessor_on(query):
18 proc = split_japanese_phrases.create(QueryConfig().set_normalizer(None))
23 @pytest.mark.parametrize('inp,outp', [('大阪府大阪市大阪', '大阪府:大阪市:大阪'),
26 def test_split_phrases(inp, outp):
27 query = [qmod.Phrase(qmod.PHRASE_ANY, inp)]
29 out = run_preprocessor_on(query)
31 assert out == [qmod.Phrase(qmod.PHRASE_ANY, outp)]