|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinpro.irmrsc.parser.CandidateAnalysis
public class CandidateAnalysis
A candidate analysis entertained by the SITDBSParser
, most importantly consisting of
a stack, a derivation history and the probability of the derivation.
expand(Production)
) and match (match(Symbol)
),
as well as the robust operations for insertions (insert(Symbol)
), deletions
(deletion(Symbol)
) and repairs (repair(Symbol)
). The probability of a derivation
can be externally degraded, as in the reference-pruning-setting.
Field Summary | |
---|---|
private CandidateAnalysis |
mAntecedent
the former analysis of which this is an extension |
private java.util.List<java.lang.String> |
mDerivation
the sequence of all rules used in this derivation |
private double |
mFigureOfMerit
the product of the derivations probability and the lookahead probability -- not used at the moment |
private java.util.List<java.lang.String> |
mLastDerive
the sequence of rules used in the last incremental step of the derivation |
private double |
mProbability
the product of all rule probabilities used in the derivation and all external mali |
private java.util.Deque<Symbol> |
mStack
the sequence of nonterminal symbols that need to be accounted for |
Constructor Summary | |
---|---|
CandidateAnalysis(CandidateAnalysis ca)
copy constructor |
|
CandidateAnalysis(java.util.Deque<Symbol> mStack)
constructor to initiate a chain of derivations |
|
CandidateAnalysis(java.util.List<java.lang.String> mDerivation,
java.util.List<java.lang.String> mLastDerive,
CandidateAnalysis mAntecedent,
java.util.Deque<Symbol> mStack,
double mProbability,
double mFigureOfMerit)
|
Method Summary | |
---|---|
int |
compareTo(CandidateAnalysis y)
|
void |
consumeFiller(java.lang.String fillername)
simply adds a filler to this derivation without changing anything else |
void |
degradeProbability(double f)
|
CandidateAnalysis |
deletion(Symbol deletedToken)
The robust 'deletion' parsing action: An expected but non-existing token is considered to be existing and simply matched. |
CandidateAnalysis |
expand(Production p)
The 'predict' parsing action: The top stack element is popped and the symbols on the righthandside of the predicte rule are pushed onto the stack. |
CandidateAnalysis |
getAntecedent()
|
double |
getFigureOfMerit()
|
java.util.List<java.lang.String> |
getLastDerive()
|
int |
getNumberOfDeletions()
|
int |
getNumberOfInsertions()
|
int |
getNumberOfMatches()
|
int |
getNumberOfRepairs()
|
double |
getProbability()
|
java.util.Deque<Symbol> |
getStack()
|
Symbol |
getTopSymbol()
|
boolean |
hasRobustOperationsLately()
|
CandidateAnalysis |
insert(Symbol insertedToken)
The robust 'insertion' parsing action: A unexpected token is added to the derivation without altering the stack. |
boolean |
isCompletable(java.util.Set<Symbol> epsilonproductions)
|
boolean |
isComplete()
|
private CandidateAnalysis |
match_intern(java.lang.String deriveIdentifier)
|
CandidateAnalysis |
match(Symbol nextToken)
The 'match' parsing action: An expected token is matched. |
void |
newIncrementalStep(CandidateAnalysis oldCA)
links this analysis to an antecedent analysis |
java.lang.String |
printDerivation()
|
CandidateAnalysis |
repair(Symbol requiredToken)
The robust 'repair' parsing action: An unexpected token is replaced by the expected token and simply matched. |
java.lang.String |
toFinalString()
|
java.lang.String |
toFullString()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private java.util.List<java.lang.String> mDerivation
private java.util.List<java.lang.String> mLastDerive
private CandidateAnalysis mAntecedent
private java.util.Deque<Symbol> mStack
private double mProbability
private double mFigureOfMerit
Constructor Detail |
---|
public CandidateAnalysis(java.util.List<java.lang.String> mDerivation, java.util.List<java.lang.String> mLastDerive, CandidateAnalysis mAntecedent, java.util.Deque<Symbol> mStack, double mProbability, double mFigureOfMerit)
public CandidateAnalysis(java.util.Deque<Symbol> mStack)
public CandidateAnalysis(CandidateAnalysis ca)
Method Detail |
---|
public CandidateAnalysis expand(Production p)
p
- the grammar rule that is predicted
public CandidateAnalysis repair(Symbol requiredToken)
requiredToken
- the token that was expected next in the derivation
public CandidateAnalysis deletion(Symbol deletedToken)
deletedToken
- the token that was expected but not found
public CandidateAnalysis match(Symbol nextToken)
nextToken
- the expected token
private CandidateAnalysis match_intern(java.lang.String deriveIdentifier)
public CandidateAnalysis insert(Symbol insertedToken)
insertedToken
- the unexpected token to be inserted
public void consumeFiller(java.lang.String fillername)
public void newIncrementalStep(CandidateAnalysis oldCA)
public CandidateAnalysis getAntecedent()
public boolean isComplete()
public boolean isCompletable(java.util.Set<Symbol> epsilonproductions)
public Symbol getTopSymbol()
public java.util.Deque<Symbol> getStack()
public double getProbability()
public void degradeProbability(double f)
public double getFigureOfMerit()
public java.util.List<java.lang.String> getLastDerive()
public boolean hasRobustOperationsLately()
public int getNumberOfMatches()
public int getNumberOfRepairs()
public int getNumberOfInsertions()
public int getNumberOfDeletions()
public int compareTo(CandidateAnalysis y)
compareTo
in interface java.lang.Comparable<CandidateAnalysis>
public java.lang.String toFinalString()
public java.lang.String toFullString()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String printDerivation()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |