]> git.openstreetmap.org Git - nominatim.git/blob - nominatim/tools/special_phrases/special_phrase.py
d9bf9e58e82c40441045ce205c6c7e2bc42550ab
[nominatim.git] / nominatim / tools / special_phrases / special_phrase.py
1 # SPDX-License-Identifier: GPL-2.0-only
2 #
3 # This file is part of Nominatim. (https://nominatim.org)
4 #
5 # Copyright (C) 2022 by the Nominatim developer community.
6 # For a full list of authors see the git log.
7 """
8     Module containing the class SpecialPhrase.
9
10     This class is a model used to transfer a special phrase through
11     the process of load and importation.
12 """
13 class SpecialPhrase():
14     """
15         Model representing a special phrase.
16     """
17     def __init__(self, p_label, p_class, p_type, p_operator):
18         self.p_label = p_label.strip()
19         self.p_class = p_class.strip()
20         # Hack around a bug where building=yes was imported with quotes into the wiki
21         self.p_type = p_type.strip()
22         # Needed if some operator in the wiki are not written in english
23         p_operator = p_operator.strip().lower()
24         self.p_operator = '-' if p_operator not in ('near', 'in') else p_operator