public class NonCondensedIntersectionAutomaton<LeftState,RightState> extends TreeAutomaton<Pair<LeftState,RightState>>
GenericCondensedIntersectionAutomaton that expands each
condensed rule into the individual ordinary rules it represents. This makes
the intersection algorithm extremely inefficient. This class should not be
used in practical parsers; it is only intended as a baseline to quantify the
performance benefits of condensed automata.| Modifier and Type | Class and Description |
|---|---|
static interface |
NonCondensedIntersectionAutomaton.IntersectionCall |
TreeAutomaton.BottomUpStateVisitor| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEBUG |
D, DEBUG_STORE| Constructor and Description |
|---|
NonCondensedIntersectionAutomaton(TreeAutomaton<LeftState> left,
CondensedTreeAutomaton<RightState> right)
Assumes the signatures are identical.
|
NonCondensedIntersectionAutomaton(TreeAutomaton<LeftState> left,
CondensedTreeAutomaton<RightState> right,
SignatureMapper sigMapper) |
NonCondensedIntersectionAutomaton(TreeAutomaton<LeftState> left,
CondensedTreeAutomaton<RightState> right,
SignatureMapper sigMapper,
boolean debug) |
| Modifier and Type | Method and Description |
|---|---|
IntSet |
getFinalStates()
Returns the IDs of the final states of the automaton.
|
int |
getNumberOfSeenRhsStates() |
Iterable<Rule> |
getRulesBottomUp(int label,
int[] childStates)
Finds automaton rules bottom-up for a given list of child states and a
given parent label.
|
Iterable<Rule> |
getRulesTopDown(int label,
int parentState)
Finds automaton rules top-down for a given parent state and label.
|
static NonCondensedIntersectionAutomaton |
intersectTopDownBottomUpNonCondensed(TreeAutomaton lhs,
CondensedTreeAutomaton rhs) |
boolean |
isBottomUpDeterministic()
Determines whether the automaton is deterministic if read as a bottom-up
automaton.
|
static void |
main(String[] args,
boolean showViterbiTrees,
NonCondensedIntersectionAutomaton.IntersectionCall icall)
Function to test the efficiency of this intersection algorithm by parsing
each sentence in a text file with a given IRTG.
|
void |
makeAllRulesExplicit()
Computes all rules in this automaton and stores them in the cache.
|
accepts, acceptsRaw, analyze, asConcreteTreeAutomaton, asConcreteTreeAutomatonBottomUp, asConcreteTreeAutomatonWithStringStates, countTrees, createRule, createRule, createRule, createRule, createRule, createRule, determinize, determinize, dumpToFile, equals, evaluateInSemiring, evaluateInSemiring, evaluateInSemiringTopDown, foreachRuleBottomUpForSets, foreachRuleTopDown, foreachStateInBottomUpOrder, getAllLabels, getAllRulesTopDown, getAllStates, getIdForState, getLabelsTopDown, getNumberOfRules, getNumberOfSeenStates, getRandomRuleTree, getRandomRuleTreeFromInside, getRandomTree, getRandomTreeFromInside, getReachableStates, getRulesBottomUp, getRulesBottomUp, getRuleSet, getRulesForRhsState, getRulesTopDown, getRuleTree, getSignature, getStateForId, getStateInterner, getStatesInBottomUpOrder, getStoredConstantsForID, getWeight, getWeightRaw, hasRuleWithPrefix, hasStoredConstants, homomorphism, inside, intersect, intersect, intersectBottomUp, intersectCondensed, intersectCondensed, intersectCondensed, intersectCondensedBottomUp, intersectCondensedBottomUp, intersectEarley, intersectViterbi, intersectViterbi, inverseCondensedHomomorphism, inverseHomomorphism, isCyclic, isEmpty, isStoring, language, languageIterable, languageIterator, languageIteratorRaw, languageRaw, newSiblingFinder, normalizeRuleWeights, outside, processAllRulesBottomUp, processAllRulesTopDown, reduceTopDown, run, run, runRaw, setRulePrintingFilter, setSkipFail, setStoring, sortedLanguageIterator, supportsBottomUpQueries, supportsTopDownQueries, toString, toStringBottomUp, useSiblingFinder, viterbi, viterbiRaw, writepublic NonCondensedIntersectionAutomaton(TreeAutomaton<LeftState> left, CondensedTreeAutomaton<RightState> right)
left - right - public NonCondensedIntersectionAutomaton(TreeAutomaton<LeftState> left, CondensedTreeAutomaton<RightState> right, SignatureMapper sigMapper, boolean debug)
public NonCondensedIntersectionAutomaton(TreeAutomaton<LeftState> left, CondensedTreeAutomaton<RightState> right, SignatureMapper sigMapper)
public int getNumberOfSeenRhsStates()
public void makeAllRulesExplicit()
TreeAutomatonmakeAllRulesExplicit in class TreeAutomaton<Pair<LeftState,RightState>>public boolean isBottomUpDeterministic()
TreeAutomatonisBottomUpDeterministic in class TreeAutomaton<Pair<LeftState,RightState>>public IntSet getFinalStates()
TreeAutomatongetFinalStates in class TreeAutomaton<Pair<LeftState,RightState>>public Iterable<Rule> getRulesBottomUp(int label, int[] childStates)
TreeAutomatongetRulesBottomUp in class TreeAutomaton<Pair<LeftState,RightState>>public Iterable<Rule> getRulesTopDown(int label, int parentState)
TreeAutomaton
Note that not every method of TreeAutomaton is safely available in your
implementation of getRulesTopDown. Most notably, you can't use the
default implementation of TreeAutomaton.getAllStates(), because that method
makes all rules of the automaton explicit and calls TreeAutomaton.getRulesTopDown(int, int)
in the process, leading to an infinite recursion.
getRulesTopDown in class TreeAutomaton<Pair<LeftState,RightState>>public static NonCondensedIntersectionAutomaton intersectTopDownBottomUpNonCondensed(TreeAutomaton lhs, CondensedTreeAutomaton rhs)
public static void main(String[] args, boolean showViterbiTrees, NonCondensedIntersectionAutomaton.IntersectionCall icall) throws FileNotFoundException, ParseException, IOException, ParserException, CodecParseException
args - CMD argumentsshowViterbiTrees - icall - what intersection should be used?FileNotFoundExceptionParseExceptionIOExceptionParserExceptionAntlrIrtgBuilder.ParseExceptionParseExceptionCodecParseExceptionCopyright © 2017. All rights reserved.