mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-14 18:37:58 +00:00
move name matching into tokenizer module
Instead of requesting the match tokens from the tokenizer when looking for parent streets/places and address parts, hand in the saved tokens and ask if they match. This gives the tokenizer more freedom to decide how name matching should be done.
This commit is contained in:
@@ -43,7 +43,7 @@ LANGUAGE plpgsql STABLE;
|
||||
|
||||
|
||||
-- find the parent road of the cut road parts
|
||||
CREATE OR REPLACE FUNCTION get_interpolation_parent(street INTEGER[], place INTEGER[],
|
||||
CREATE OR REPLACE FUNCTION get_interpolation_parent(token_info JSONB,
|
||||
partition SMALLINT,
|
||||
centroid GEOMETRY, geom GEOMETRY)
|
||||
RETURNS BIGINT
|
||||
@@ -52,7 +52,7 @@ DECLARE
|
||||
parent_place_id BIGINT;
|
||||
location RECORD;
|
||||
BEGIN
|
||||
parent_place_id := find_parent_for_address(street, place, partition, centroid);
|
||||
parent_place_id := find_parent_for_address(token_info, partition, centroid);
|
||||
|
||||
IF parent_place_id is null THEN
|
||||
FOR location IN SELECT place_id FROM placex
|
||||
@@ -155,9 +155,8 @@ BEGIN
|
||||
NEW.interpolationtype = NEW.address->'interpolation';
|
||||
|
||||
place_centroid := ST_PointOnSurface(NEW.linegeo);
|
||||
NEW.parent_place_id = get_interpolation_parent(token_addr_street_match_tokens(NEW.token_info),
|
||||
token_addr_place_match_tokens(NEW.token_info),
|
||||
NEW.partition, place_centroid, NEW.linegeo);
|
||||
NEW.parent_place_id = get_interpolation_parent(NEW.token_info, NEW.partition,
|
||||
place_centroid, NEW.linegeo);
|
||||
|
||||
interpol_postcode := token_normalized_postcode(NEW.address->'postcode');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user