Add:Tools:Added multiple index entries for special chars
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Tue, 23 Jun 2009 19:30:28 +0000 (19:30 +0000)
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Tue, 23 Jun 2009 19:30:28 +0000 (19:30 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@2360 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/attr_def.h
navit/navit/linguistics.c
navit/navit/osm2navit.c

index 912a1f4..3459bb1 100644 (file)
@@ -119,6 +119,7 @@ ATTR(house_number_interpolation)
 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_first)
 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)
index 0fb11c0..f03dc88 100644 (file)
@@ -35,7 +35,8 @@ linguistics_expand_special(char *str, int mode)
        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;
index 6d7c4fc..7c84515 100644 (file)
@@ -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 @@ end_node(FILE *out)
                                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 @@ sort_countries_compare(const void *p1, const void *p2)
        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);