Adding code to dump the words as sql.
--- a/zhash.c Fri Mar 30 18:54:55 2012 +0200
+++ b/zhash.c Fri Mar 30 18:55:30 2012 +0200
@@ -175,6 +175,18 @@
printf("\n");
}
+static void dump_word_sql(struct WordEntry *word)
+{
+ struct BareWord *tmp;
+ printf("INSERT INTO vortoj (trovo, akcentigita, motoj) VALUES ('%s', '%s', '", word->str, word->accented->str);
+
+ for(tmp = word->unflexed; tmp != 0; tmp = tmp->next)
+ {
+ printf(" %s", tmp->str);
+ }
+ printf("');\n");
+}
+
void dump_wordlist()
{
int i;
@@ -185,7 +197,7 @@
while (word != 0)
{
if (word->str)
- dump_word(word);
+ dump_word_sql(word);
word = word->next;
}
}