Command ranking criterion. This is used by the CommandRanking class to represent one criterion for comparing two parse trees.

Rankings are performed in two passes. The first pass is the rough, qualitative pass, meant to determine if one parse tree has big, obvious differences from another. In most cases, this means that one tree has a particular type of problem or special advantage that the other doesn't have at all.

The second pass is the fine-grained pass. We only reach the second pass if we can't find any coarse differences on the first rough pass. In most cases, the second pass compares the magnitude of problems or advantages to determine if one tree is slightly better than the other.

class CommandRankingCriterion :   object

Superclass Tree   (in declaration order)


Subclass Tree  


Global Objects  

rankByAmbiguity  rankByLiteralLength  rankByNonMatchPoss  rankBySubcommands  rankByTokenCount  rankByVerbStructure 

Summary of Properties  


Summary of Methods  

comparePass1  comparePass2 




comparePass1 (a, b)parser.t[5823]

Compare two CommandRanking objects on the basis of this criterion, for the first, coarse-grained pass. Returns a positive number if a is better than b, 0 if they're indistinguishable, or -1 if a is worse than b.

comparePass2 (a, b)parser.t[5826]
compare two rankings for the second, fine-grained pass

TADS 3 Library Manual
Generated on 5/16/2013 from TADS version 3.1.3