Fix:Core:Corretly set moved flag
[navit-package] / navit / linguistics.c
index 2ac7ad0..6467c36 100644 (file)
@@ -5,11 +5,15 @@
 #include "linguistics.h"
 
 static const char *special[][3]={
+/* Capital Diacritics */
+/* ¨ Diaresis */
 {"Ä","A","AE"},
 {"Ö","O","OE"},
 {"Ü","U","UE"},
+/* ˝ Double Acute Accent */
 {"Ő","O"},
 {"Ű","U"},
+/* ´ Acute Accent */
 {"Á","A"},
 {"Ć","C"},
 {"É","E"},
@@ -18,16 +22,40 @@ static const char *special[][3]={
 {"Ó","O"},
 {"Ś","S"},
 {"Ú","U"},
+{"Ý","Y"},
 {"Ź","Z"},
+/* ˛ Ogonek */
 {"Ą","A"},
 {"Ę","E"},
+/* ˙ Dot */
 {"Ż","Z"},
+/* – Stroke */
 {"Ł","L"},
+/* ˚ Ring */
+{"Å","A","AA"},
+{"Ů","U"},
+/* ˇ Caron */
+{"Č","C"},
+{"Ď","D"},
+{"Ě","E"},
+{"Ň","N"},
+{"Ř","R"},
+{"Š","S"},
+{"Ť","T"},
+{"Ž","Z"},
+/* / Slash */
+{"Ø","O","OE"},
+/* ligatures */
+{"Æ","A","AE"},
+/* Small Diacritics */
+/* ¨ Diaresis */
 {"ä","a","ae"},
 {"ö","o","oe"},
 {"ü","u","ue"},
+/* ˝ Double Acute Accent */
 {"ő","o"},
 {"ű","u"},
+/* ´ Acute Accent */
 {"á","a"},
 {"ć","c"},
 {"é","e"},
@@ -36,11 +64,31 @@ static const char *special[][3]={
 {"ó","o"},
 {"ś","s"},
 {"ú","u"},
+{"ý","y"},
 {"ź","z"},
+/* ˛ Ogonek */
 {"ą","a"},
 {"ę","e"},
+/* ˙ Dot */
 {"ż","z"},
+/* – Stroke */
 {"ł","l"},
+/* ˚ Ring */
+{"ů","u"},
+{"å","a", "aa"},
+/* ˇ Caron */
+{"č","c"},
+{"ď","d"},
+{"ě","e"},
+{"Ň","N"},
+{"ř","r"},
+{"š","s"},
+{"ť","t"},
+{"ž","z"},
+/* / Slash */
+{"ø","o", "oe"},
+/* ligatures */
+{"æ","a","ae"},
 {"ß","s","ss"},
 };
 
@@ -65,7 +113,7 @@ linguistics_expand_special(char *str, int mode)
                                        if (replace) {
                                                int replace_len=strlen(replace);
                                                dbg_assert(replace_len <= len);
-                                               dbg(1,"found %s %s %s\n",in,search,replace);
+                                               dbg(1,"found %s %s %d %s %d\n",in,search,len,replace,replace_len);
                                                strcpy(out, replace);
                                                out+=replace_len;
                                                match=1;
@@ -73,11 +121,11 @@ linguistics_expand_special(char *str, int mode)
                                        }
                                }
                        }
-                       in=next;
                }
-               if (match) 
+               if (match) {
                        found=1;
-               else {  
+                       in=next;
+               } else {
                        while (len-- > 0) 
                                *out++=*in++;
                }
@@ -89,3 +137,17 @@ linguistics_expand_special(char *str, int mode)
        }
        return ret;
 }
+
+char *
+linguistics_next_word(char *str)
+{
+       int len=strcspn(str, " -/()");
+       if (!str[len] || !str[len+1])
+               return NULL;
+       return str+len+1;
+}
+
+void
+linguistics_init(void)
+{
+}