|
|||||||||
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
|
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 newArcs)
Uses the Arcs newArcs. |
|
TransducerGraph(Set 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. |
Object |
clone()
|
static TransducerGraph |
createGraphFromPaths(Counter 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 |
ensure(Object o)
|
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 |
getArcs()
|
Set |
getArcsByInput(Object node)
Returns a Set of type TransducerGraph.Arc. |
Set |
getArcsBySource(Object node)
Returns a Set of type TransducerGraph.Arc. |
Set |
getArcsByTarget(Object node)
Returns a Set of type TransducerGraph.Arc. |
Set |
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 |
getPathOutputs(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 pathList,
TransducerGraph graph,
boolean printPaths)
For testing only. |
boolean |
removeArc(TransducerGraph.Arc a)
|
Map |
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 newArcs, Object startNode, Set endNodes, TransducerGraph.ArcProcessor arcProcessor, TransducerGraph.NodeProcessor nodeProcessor)
public TransducerGraph(Set newArcs)
Method Detail |
---|
public void setDeterminism(boolean checkDeterminism)
public Object clone()
clone
in class Object
public Set 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 getArcsByInput(Object node)
public Set getArcsBySource(Object node)
protected Set ensure(Object o)
public Set getArcsByTarget(Object node)
public TransducerGraph.Arc getArcBySourceAndInput(Object node, Object input)
public Set 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 samplePathsFromGraph(int numPaths)
public static void printPathOutputs(List pathList, TransducerGraph graph, boolean printPaths)
public List getPathOutputs(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 TransducerGraph createGraphFromPaths(Counter 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 |