From: <mar...@us...> - 2009-06-23 19:30:30
|
Revision: 2360 http://navit.svn.sourceforge.net/navit/?rev=2360&view=rev Author: martin-s Date: 2009-06-23 19:30:28 +0000 (Tue, 23 Jun 2009) Log Message: ----------- Add:Tools:Added multiple index entries for special chars Modified Paths: -------------- trunk/navit/navit/attr_def.h trunk/navit/navit/linguistics.c trunk/navit/navit/osm2navit.c Modified: trunk/navit/navit/attr_def.h =================================================================== --- trunk/navit/navit/attr_def.h 2009-06-23 19:10:31 UTC (rev 2359) +++ trunk/navit/navit/attr_def.h 2009-06-23 19:30:28 UTC (rev 2360) @@ -119,6 +119,7 @@ ATTR(house_number_left_interpolation) ATTR(house_number_right_interpolation) ATTR(delay) +ATTR(lag) ATTR2(0x00027500,type_rel_abs_begin) /* These attributes are int that can either hold relative * @@ -245,6 +246,9 @@ ATTR(house_number_left_last) ATTR(house_number_right_first) ATTR(house_number_right_last) +ATTR(town_name_match) +ATTR(district_name_match) +ATTR(street_name_match) ATTR2(0x0003ffff,type_string_end) ATTR2(0x00040000,type_special_begin) ATTR(order) Modified: trunk/navit/navit/linguistics.c =================================================================== --- trunk/navit/navit/linguistics.c 2009-06-23 19:10:31 UTC (rev 2359) +++ trunk/navit/navit/linguistics.c 2009-06-23 19:30:28 UTC (rev 2360) @@ -35,7 +35,8 @@ char *out,*ret; int found=0; out=ret=g_strdup(str); - mode++; + if (!mode) + return ret; while (*in) { char *next=g_utf8_find_next_char(in, NULL); int i,len=next-in; Modified: trunk/navit/navit/osm2navit.c =================================================================== --- trunk/navit/navit/osm2navit.c 2009-06-23 19:10:31 UTC (rev 2359) +++ trunk/navit/navit/osm2navit.c 2009-06-23 19:30:28 UTC (rev 2360) @@ -39,6 +39,7 @@ #include "zipfile.h" #include "main.h" #include "config.h" +#include "linguistics.h" #include "plugin.h" #ifdef HAVE_POSTGRESQL #include <libpq-fe.h> @@ -1509,10 +1510,20 @@ g_free(name); } if (result->file) { - item_bin_init(item_bin, item_bin->type); - item_bin_add_coord(item_bin, &ni->c, 1); - item_bin_add_attr_string(item_bin, attr_town_name, attr_strings[attr_string_label]); - item_bin_write(item_bin, result->file); + int i; + for (i = 0 ; i < 3 ; i++) { + char *town_name=attr_strings[attr_string_label]; + char *str=linguistics_expand_special(town_name, i); + if (str) { + item_bin_init(item_bin, item_bin->type); + item_bin_add_coord(item_bin, &ni->c, 1); + if (i) + item_bin_add_attr_string(item_bin, attr_town_name_match, str); + item_bin_add_attr_string(item_bin, attr_town_name, town_name); + item_bin_write(item_bin, result->file); + g_free(str); + } + } } } @@ -1530,8 +1541,8 @@ assert(ib2->clen==2); attr1=(struct attr_bin *)((int *)(ib1+1)+ib1->clen); attr2=(struct attr_bin *)((int *)(ib2+1)+ib1->clen); - assert(attr1->type == attr_town_name); - assert(attr2->type == attr_town_name); + assert(attr1->type == attr_town_name || attr1->type == attr_town_name_match); + assert(attr2->type == attr_town_name || attr2->type == attr_town_name_match); s1=(char *)(attr1+1); s2=(char *)(attr2+1); return strcmp(s1, s2); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |