[Geocoding] Regarding issue #967
K Rahul Reddy
k_rahul_reddy at outlook.com
Wed Apr 1 00:06:00 UTC 2020
Hi!
For issue #967 <https://github.com/osm-search/Nominatim/issues/967>,
These are some points I found so far:
In Geocode.php lookup(),
1) The sNormQuery is made by using PHP's Transliterator.
2) The normalization method make_standard_name is used on phrases in
line 630. This is an sql function which returns
trim(public.gettokenstring(public.transliteration(name))).
We need to replace %09-%0d characters in phrases. This can be done
simply by adding
$sPhrase = preg_replace('/[\x09|\x0a|\x0b|\x0c|\x0d]/',
' ', $sPhrase);
before normalization function is called.
3) Other solution would be to change normalization(breaks the DB). The
transliteration() uses the utfasciitable.h
Changing UTFASCIILOOKUP by replacing 9-13 th position elements by
'2' does the job.
I have tested both the ways, and both seem to work as expected. What
should I do now?
Regards,
Rahul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/geocoding/attachments/20200401/68b91ab2/attachment.htm>
More information about the Geocoding
mailing list