1 # SPDX-License-Identifier: GPL-2.0-only
3 # This file is part of Nominatim. (https://nominatim.org)
5 # Copyright (C) 2022 by the Nominatim developer community.
6 # For a full list of authors see the git log.
8 Module containing the class SpecialPhrase.
10 This class is a model used to transfer a special phrase through
11 the process of load and importation.
15 class SpecialPhrase():
17 Model representing a special phrase.
19 def __init__(self, p_label, p_class, p_type, p_operator):
20 self.p_label = p_label.strip()
21 self.p_class = p_class.strip()
22 # Hack around a bug where building=yes was imported with quotes into the wiki
23 self.p_type = re.sub(r'\"|"', '', p_type.strip())
24 # Needed if some operator in the wiki are not written in english
25 p_operator = p_operator.strip().lower()
26 self.p_operator = '-' if p_operator not in ('near', 'in') else p_operator