[PEAK] Regular functions vs generic functions

rdmurray at bitdance.com rdmurray at bitdance.com
Fri Feb 15 11:54:06 EST 2008


On Fri, 15 Feb 2008 at 11:32, Phillip J. Eby wrote:
> Can you send source for this?  You can get rid of the rule bodies, since 
> those won't affect the tree build time.  That way, I can profile the build

Well, I'm feeling a little tentative, since what I'm doing is probably
not the smartest way to do what I'm doing...but nothing ventured nothing
gained.  On the other hand I can't just cut and paste the rules...see
below for why.

> The other possibility, of course, is that there's something really 
> pathological about the ruleset itself, like a ruleset with lots of ambiguity, 
> or where class-instance tests are at the leaves of the tree instead of the 
> roots.  That could potentially cause an exponential blowup in the size of the

It could be either, I suppose.  The main part of the ap is an NL parser,
which I remember playing with back in college using LISP, so I was excited
to hear that the dispatch tree was CLOSish.  Not that I remember enough
details of that course or the theory behind it to be doing this right,
but I am having fun playing with it :)

So, I have rules in my code that look like this:

     @analyze.when(matches("~NP A+~D"))

which results in a rule like:

     len(s)>=2 and (not s[0].isNP) and (s[1].isA and not s[1].isD)

So, I'll have to play around with the code a bit to get you a list
of the rules in expanded form.  I'm away this weekend, so it will
probably be sometime next week before I can send anything.

Oh, and by the way, when I said five seconds that was wall clock time,
in case that wasn't clear.  My dev machine isn't exactly a slowpoke,
though.

--David



More information about the PEAK mailing list