mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-12 22:04:07 +00:00
strip normalisation results of normal and special spaces
This commit is contained in:
@@ -27,5 +27,5 @@ def create(config: QueryConfig) -> QueryProcessingFunc:
|
|||||||
|
|
||||||
return lambda phrases: list(
|
return lambda phrases: list(
|
||||||
filter(lambda p: p.text,
|
filter(lambda p: p.text,
|
||||||
(Phrase(p.ptype, cast(str, normalizer.transliterate(p.text)))
|
(Phrase(p.ptype, cast(str, normalizer.transliterate(p.text)).strip('-: '))
|
||||||
for p in phrases)))
|
for p in phrases)))
|
||||||
|
|||||||
@@ -244,7 +244,7 @@ class ICUQueryAnalyzer(AbstractQueryAnalyzer):
|
|||||||
standardized form search will work with. All information removed
|
standardized form search will work with. All information removed
|
||||||
at this stage is inevitably lost.
|
at this stage is inevitably lost.
|
||||||
"""
|
"""
|
||||||
return cast(str, self.normalizer.transliterate(text))
|
return cast(str, self.normalizer.transliterate(text)).strip('-: ')
|
||||||
|
|
||||||
def split_query(self, query: qmod.QueryStruct) -> Tuple[QueryParts, WordDict]:
|
def split_query(self, query: qmod.QueryStruct) -> Tuple[QueryParts, WordDict]:
|
||||||
""" Transliterate the phrases and split them into tokens.
|
""" Transliterate the phrases and split them into tokens.
|
||||||
|
|||||||
Reference in New Issue
Block a user