LeftState
- RightState
- public class IntersectionAutomaton<LeftState,RightState> extends TreeAutomaton<Pair<LeftState,RightState>>
Modifier and Type | Class and Description |
---|---|
static interface |
IntersectionAutomaton.StateDiscoveryListener
Defines an interface which accepts newly discovered states during
the intersection construction.
|
TreeAutomaton.BottomUpStateVisitor
D, DEBUG_STORE
Constructor and Description |
---|
IntersectionAutomaton(TreeAutomaton<LeftState> left,
TreeAutomaton<RightState> right)
Crates a new instance which represents the intersection of the two given automata.
|
Modifier and Type | Method and Description |
---|---|
IntSet |
getFinalStates()
Returns the IDs of the final states of the automaton.
|
int |
getLeftState(int outputState)
Returns the state in the left automaton for this outputState.
|
int |
getRightState(int outputState)
Returns the state in the right automaton for this outputState.
|
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 IntersectionAutomaton |
intersectBottomUpNaive(TreeAutomaton lhs,
TreeAutomaton rhs)
Helper method which creates an intersection automaton and
makes all rules explicit with the default algorithm.
|
static IntersectionAutomaton |
intersectTopDownBottomUpCKY(TreeAutomaton lhs,
TreeAutomaton rhs)
Helper method which creates an intersection automaton and
makes all rules explicit with the CKY algorithm.
|
boolean |
isBottomUpDeterministic()
Determines whether the automaton is deterministic if read as a bottom-up
automaton.
|
void |
makeAllRulesExplicit()
Computes all rules in this automaton and stores them in the cache.
|
void |
makeAllRulesExplicitCKY()
This method constructs all transitions in the automaton in a CKY style
algorithm.
|
void |
makeAllRulesExplicitCKYOld()
This method constructs all transitions in the automaton in a CKY style
algorithm, there is a newer version that is preferred.
|
void |
makeAllRulesExplicitEarley()
This implements an interesection algorithm in the style of the early
algorithm, which predicts possible transition based on the first input
automaton and then finds matching rules based on the second input automaton.
|
void |
setStateDiscoveryListener(IntersectionAutomaton.StateDiscoveryListener listener)
The listener will be informed whenever a new state is visited for the first
time.
|
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, write
public IntersectionAutomaton(TreeAutomaton<LeftState> left, TreeAutomaton<RightState> right)
left
- right
- public void setStateDiscoveryListener(IntersectionAutomaton.StateDiscoveryListener listener)
listener
- public int getLeftState(int outputState)
outputState
- public int getRightState(int outputState)
outputState
- public boolean isBottomUpDeterministic()
TreeAutomaton
isBottomUpDeterministic
in class TreeAutomaton<Pair<LeftState,RightState>>
public void makeAllRulesExplicitCKY()
public void makeAllRulesExplicitCKYOld()
public void makeAllRulesExplicit()
TreeAutomaton
makeAllRulesExplicit
in class TreeAutomaton<Pair<LeftState,RightState>>
public IntSet getFinalStates()
TreeAutomaton
getFinalStates
in class TreeAutomaton<Pair<LeftState,RightState>>
public Iterable<Rule> getRulesBottomUp(int label, int[] childStates)
TreeAutomaton
getRulesBottomUp
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 void makeAllRulesExplicitEarley()
public static IntersectionAutomaton intersectBottomUpNaive(TreeAutomaton lhs, TreeAutomaton rhs)
lhs
- rhs
- public static IntersectionAutomaton intersectTopDownBottomUpCKY(TreeAutomaton lhs, TreeAutomaton rhs)
lhs
- rhs
- Copyright © 2017. All rights reserved.