@@ -58,10 +58,16 @@ def remap_keys(obj):
5858 for lookup in obj :
5959 converted_lookup = {}
6060
61- if (lookup .match == MatchType .ENHANCED or lookup .match == "enhanced" ) and lookup .candidates == 0 :
62- add_field (converted_lookup , 'candidates' , 5 )
63- else :
61+ # Determine effective match strategy (default to ENHANCED if not specified)
62+ match_strategy = lookup .match
63+ if match_strategy is None :
64+ match_strategy = MatchType .ENHANCED
65+
66+ # Handle candidates
67+ if lookup .candidates > 0 :
6468 add_field (converted_lookup , 'candidates' , lookup .candidates )
69+ elif match_strategy == MatchType .ENHANCED or match_strategy == "enhanced" :
70+ add_field (converted_lookup , 'candidates' , 5 )
6571
6672 add_field (converted_lookup , 'input_id' , lookup .input_id )
6773 add_field (converted_lookup , 'street' , lookup .street )
@@ -74,10 +80,13 @@ def remap_keys(obj):
7480 add_field (converted_lookup , 'addressee' , lookup .addressee )
7581 add_field (converted_lookup , 'urbanization' , lookup .urbanization )
7682 add_field (converted_lookup , 'county_source' , lookup .county_source )
77- if isinstance (lookup .match , MatchType ):
78- add_field (converted_lookup , 'match' , lookup .match .value )
79- else :
80- add_field (converted_lookup , 'match' , lookup .match )
83+
84+ # Only send match parameter if not STRICT
85+ if match_strategy != MatchType .STRICT and match_strategy != "strict" :
86+ if isinstance (match_strategy , MatchType ):
87+ add_field (converted_lookup , 'match' , match_strategy .value )
88+ else :
89+ add_field (converted_lookup , 'match' , match_strategy )
8190
8291 if isinstance (lookup .outputformat , OutputFormat ):
8392 add_field (converted_lookup , 'format' , lookup .outputformat .value )
0 commit comments