On Saturday, September 8, 2012 8:21:38 AM UTC+3, Jeffrey Kegler wrote:
If the parse values in your application are trees then, yes, true_value
would be a parse tree. (In a calculator, for example, the parse
value might be an integer.) It may also be the case that it's more
convenient to just return the tree and figure out its rank afterwards.
Sure, thanks for the explanation.
The two ranking approaches aren't necessarily orthogonal. Again, take
the example of ranking parses of English sentences. You might be able
to craft a strategy where you use "rule" ranking to get an
approximation, and only generate (for example) the top 6 parses. These
you subject to a more expensive ranking algorithm and the winner of the
second ranking becomes the parse.
Well, yes.
What I was trying to say by "orthogonal" is that the application can't see the ranks set in the grammar and the grammar can't see the ranks set by the application (well it can, if they are put in the scratch pad (action sub's first arg) but doesn't and doesn't need to).
This feels like the right thing, but coming from Perl culture (TIMTOWTDI), I can't help thinking that in general the semantic actions might need to know (and perhaps to even modify) the rule's ranks set in the grammar. I can't come up with a proper use case at the moment though.
Thanks a lot for the great clarifications!