|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.fsm.TransducerGraph
public class TransducerGraph
TransducerGraph
Class for representing a deterministic finite state automaton without epsilon transitions.
Nested Class Summary | |
---|---|
static class |
TransducerGraph.Arc<NODE,IN,OUT>
|
static interface |
TransducerGraph.ArcProcessor
|
static interface |
TransducerGraph.GraphProcessor
|
static class |
TransducerGraph.InputSplittingProcessor
|
static interface |
TransducerGraph.NodeProcessor
|
static class |
TransducerGraph.NodeProcessorWrappingArcProcessor
|
static class |
TransducerGraph.NormalizingGraphProcessor
|
static class |
TransducerGraph.ObjectToSetNodeProcessor
|
static class |
TransducerGraph.OutputCombiningProcessor
|
static class |
TransducerGraph.SetToStringNodeProcessor
|
Field Summary | |
---|---|
static Object |
EPSILON_INPUT
|
Constructor Summary | |
---|---|
TransducerGraph()
|
|
TransducerGraph(Set<TransducerGraph.Arc> newArcs)
Uses the Arcs newArcs. |
|
TransducerGraph(Set<TransducerGraph.Arc> newArcs,
Object startNode,
Set endNodes,
TransducerGraph.ArcProcessor arcProcessor,
TransducerGraph.NodeProcessor nodeProcessor)
|
|
TransducerGraph(TransducerGraph other)
|
|
TransducerGraph(TransducerGraph other,
TransducerGraph.ArcProcessor arcProcessor)
|
|
TransducerGraph(TransducerGraph other,
TransducerGraph.NodeProcessor nodeProcessor)
|
Method Summary | ||
---|---|---|
boolean |
addArc(Object source,
Object target,
Object input,
Object output)
|
|
protected boolean |
addArc(TransducerGraph.Arc a)
|
|
static void |
addOnePathToGraph(List path,
double count,
int markovOrder,
TransducerGraph graph)
|
|
String |
asDOTString()
|
|
boolean |
canAddArc(Object source,
Object target,
Object input,
Object output)
|
|
boolean |
canAddPath(List path)
For testing only. |
|
TransducerGraph |
clone()
|
|
static
|
createGraphFromPaths(ClassicCounter<List<T>> pathCounter,
int markovOrder)
|
|
static TransducerGraph |
createGraphFromPaths(List paths,
int markovOrder)
If markovOrder is zero, we always transition back to the start state If markovOrder is negative, we assume that it is infinite |
|
static TransducerGraph |
createRandomGraph(int numPaths,
int pathLengthMean,
double pathLengthVariance,
int numInputs,
List pathList)
For testing only. |
|
static List |
createRandomPaths(int numPaths,
int pathLengthMean,
double pathLengthVariance,
int numInputs)
|
|
void |
depthFirstSearch(boolean forward,
StringBuffer b)
|
|
protected Set<TransducerGraph.Arc> |
ensure(Set<TransducerGraph.Arc> s)
|
|
TransducerGraph.Arc |
getArc(Object source,
Object target)
Slow implementation. |
|
TransducerGraph.Arc |
getArcBySourceAndInput(Object node,
Object input)
Can only be one because automaton is deterministic. |
|
Set<TransducerGraph.Arc> |
getArcs()
|
|
Set<TransducerGraph.Arc> |
getArcsByInput(Object node)
Returns a Set of type TransducerGraph.Arc. |
|
Set<TransducerGraph.Arc> |
getArcsBySource(Object node)
Returns a Set of type TransducerGraph.Arc. |
|
Set<TransducerGraph.Arc> |
getArcsByTarget(Object node)
Returns a Set of type TransducerGraph.Arc. |
|
Set<TransducerGraph.Arc> |
getArcsByTargetAndInput(Object node,
Object input)
Returns a Set of type TransducerGraph.Arc. |
|
Set |
getEndNodes()
|
|
Set |
getInputs()
|
|
Set |
getNodes()
Just does union of keysets of maps. |
|
double |
getOutputOfPathInGraph(List path)
For testing only. |
|
List<Double> |
getPathOutputs(List<List> pathList)
For testing only. |
|
double |
getSourceTotal(Object node)
|
|
Object |
getStartNode()
|
|
double |
inFlow(Object node)
|
|
static void |
main(String[] args)
For testing only. |
|
double |
outFlow(Object node)
|
|
static void |
printPathOutputs(List<List> pathList,
TransducerGraph graph,
boolean printPaths)
For testing only. |
|
boolean |
removeArc(TransducerGraph.Arc a)
|
|
Map<List,Double> |
samplePathsFromGraph(int numPaths)
|
|
List |
sampleUniformPathFromGraph()
for testing only. |
|
void |
setDeterminism(boolean checkDeterminism)
|
|
void |
setDotWeightingInverted(boolean inverted)
|
|
void |
setEndNode(Object o)
|
|
void |
setStartNode(Object o)
|
|
static boolean |
testGraphPaths(TransducerGraph sourceGraph,
TransducerGraph testGraph,
int numPaths)
|
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Object EPSILON_INPUT
Constructor Detail |
---|
public TransducerGraph()
public TransducerGraph(TransducerGraph other)
public TransducerGraph(TransducerGraph other, TransducerGraph.ArcProcessor arcProcessor)
public TransducerGraph(TransducerGraph other, TransducerGraph.NodeProcessor nodeProcessor)
public TransducerGraph(Set<TransducerGraph.Arc> newArcs, Object startNode, Set endNodes, TransducerGraph.ArcProcessor arcProcessor, TransducerGraph.NodeProcessor nodeProcessor)
public TransducerGraph(Set<TransducerGraph.Arc> newArcs)
Method Detail |
---|
public void setDeterminism(boolean checkDeterminism)
public TransducerGraph clone()
clone
in class Object
public Set<TransducerGraph.Arc> getArcs()
public Set getNodes()
public Set getInputs()
public void setStartNode(Object o)
public void setEndNode(Object o)
public Object getStartNode()
public Set getEndNodes()
public Set<TransducerGraph.Arc> getArcsByInput(Object node)
public Set<TransducerGraph.Arc> getArcsBySource(Object node)
protected Set<TransducerGraph.Arc> ensure(Set<TransducerGraph.Arc> s)
public Set<TransducerGraph.Arc> getArcsByTarget(Object node)
public TransducerGraph.Arc getArcBySourceAndInput(Object node, Object input)
public Set<TransducerGraph.Arc> getArcsByTargetAndInput(Object node, Object input)
public TransducerGraph.Arc getArc(Object source, Object target)
public boolean addArc(Object source, Object target, Object input, Object output)
protected boolean addArc(TransducerGraph.Arc a)
public boolean removeArc(TransducerGraph.Arc a)
public boolean canAddArc(Object source, Object target, Object input, Object output)
public String toString()
toString
in class Object
public void setDotWeightingInverted(boolean inverted)
public String asDOTString()
public double inFlow(Object node)
public double outFlow(Object node)
public double getSourceTotal(Object node)
public double getOutputOfPathInGraph(List path)
public List sampleUniformPathFromGraph()
public Map<List,Double> samplePathsFromGraph(int numPaths)
public static void printPathOutputs(List<List> pathList, TransducerGraph graph, boolean printPaths)
public List<Double> getPathOutputs(List<List> pathList)
public static boolean testGraphPaths(TransducerGraph sourceGraph, TransducerGraph testGraph, int numPaths)
public boolean canAddPath(List path)
public static TransducerGraph createGraphFromPaths(List paths, int markovOrder)
public static <T> TransducerGraph createGraphFromPaths(ClassicCounter<List<T>> pathCounter, int markovOrder)
public static void addOnePathToGraph(List path, double count, int markovOrder, TransducerGraph graph)
public static TransducerGraph createRandomGraph(int numPaths, int pathLengthMean, double pathLengthVariance, int numInputs, List pathList)
public static List createRandomPaths(int numPaths, int pathLengthMean, double pathLengthVariance, int numInputs)
public void depthFirstSearch(boolean forward, StringBuffer b)
public static void main(String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |