Added root words in the result.
--- 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()