Hi,

do you have some block diagram of munch? I allready tried to look at source but
did not got the idea where/how i could influence the munch's decisions.

Sorry no block diagram but here is the C code from munch.c

Think of p as a pointer to the entry with the shortest root word and rl
as the length of the shortest root word



     if (numroots) {
            /* now there might be a number of combinations */
            /* of prefixes and suffixes that might match this */
            /* word.  So how to choose?  As a first shot look */
            /* for the shortest remaining root word to */
            /* to maximize the combinatorial power */

            /* but be careful, do not REQUIRE a specific combination */
            /* of a prefix and a suffix to generate the word since */
            /* that violates the rule that the root word with just */
            /* the prefix or just the suffix must also exist in the */
            /* wordlist as well */

/* in fact because of the cross product issue, this not a */
/* simple choice since some combinations of previous */
/* prefixes and new suffixes may not be valid. */
/* The only way to know is to simply try them all */


            rl = 1000;
            p = -1;

            for (j = 0; j < numroots; j++){

              /* first collect the root word info and build up */
              /* the potential new affix string */

 ... snip to simplify ...

               /* now expand the potential affix string to generate */
               /* all legal words and make sure they all exist in the */
               /* word list */
               numwords = 0;
               wlist[numwords].word = mystrdup(nword);
               wlist[numwords].pallow = 0;
               numwords++;
               n = 0;
               if (al)
                 expand_rootword(nword,nwl,as,al);
               for (k=0; k<numwords; k++) {
                 if (lookup(wlist[k].word)) n++;
                 free(wlist[k].word);
                 wlist[k].word = NULL;
                 wlist[k].pallow = 0;
               }

               /* if all exist in word list then okay */
               if (n == numwords) {
                  if (nwl < rl) {
                     rl = nwl;
                     p = j;
                  }
               }
            }


So the code simply looks at all legal root words and affix combinations and chooses the one where rl is the smallest (p keep track of which root word that is).


Hope this helps,

Kevin


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to