# HG changeset patch # User viric@llimona # Date 1188283249 -7200 # Node ID f71e89074c62312c9202fda2e14fc7acd3f66dcf # Parent c755c945a96aa3a5bd2149a99558f1fdd55002e8 Added root words in the result. diff -r c755c945a96a -r f71e89074c62 zhash.c --- a/zhash.c Tue Aug 28 08:29:36 2007 +0200 +++ b/zhash.c Tue Aug 28 08:40:49 2007 +0200 @@ -100,16 +100,16 @@ /* Look for the same word */ for(tmp = pos->unflexed; tmp != 0; tmp = tmp->next) { - if (strcmp(word, pos->str) == 0) + if (strcmp(word, tmp->str) == 0) break; } + /* If not found... */ if (tmp == 0) { tmp = new_BareWord(); - } else - { - struct BareWord *new; - new = new_BareWord(); + tmp->str = strdup(word); + tmp->next = pos->unflexed; + pos->unflexed = tmp; } } } @@ -143,7 +143,7 @@ if (found) { set_accented(found, word); - /* TODO process word_no_accent */ + add_to_unflexed(found, unflexed); } else /* Does not exist */ { /* new word */ @@ -163,7 +163,14 @@ static void dump_word(struct WordEntry *word) { - printf("%s:%s\n", word->str, word->accented->str); + struct BareWord *tmp; + printf(":%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()