/** * For testing only. */ public static void main(String[] args) { List pathList = new ArrayList(); TransducerGraph graph = createRandomGraph(1000, 10, 0.0, 10, pathList); System.out.println("Done creating random graph"); printPathOutputs(pathList, graph, true); System.out.println("Depth first search from start node"); StringBuilder b = new StringBuilder(); graph.depthFirstSearch(true, b); System.out.println(b.toString()); b = new StringBuilder(); System.out.println("Depth first search back from end node"); graph.depthFirstSearch(false, b); System.out.println(b.toString()); }
public static void main(String[] args) { TransducerGraph.GraphProcessor qd = new QuasiDeterminizer(); List pathList = new ArrayList(); TransducerGraph graph = TransducerGraph.createRandomGraph(1000, 10, 1.0, 10, pathList); StringBuilder b = new StringBuilder(); graph.depthFirstSearch(true, b); System.out.println(b.toString()); System.out.println("Done creating random graph"); // TransducerGraph.printPathOutputs(pathList, graph, false); //System.out.println("Depth first search from start node"); //TransducerGraph.depthFirstSearch(graph, TransducerGraph.END_NODE, new HashSet(), 0, false); TransducerGraph newGraph = qd.processGraph(graph); System.out.println("Done quasi-determinizing"); //TransducerGraph.printPathOutputs(pathList, newGraph, false); //System.out.println("Depth first search from start node"); //TransducerGraph.depthFirstSearch(newGraph, TransducerGraph.END_NODE, new HashSet(), 0, false); TransducerGraph.testGraphPaths(graph, newGraph, 1000); }
public static void main(String[] args) { TransducerGraph fa = new TransducerGraph(); fa.addArc(fa.getStartNode(), "1", "a", ""); fa.addArc(fa.getStartNode(), "2", "b", ""); fa.addArc(fa.getStartNode(), "3", "c", ""); fa.addArc("1", "4", "a", ""); fa.addArc("2", "4", "a", ""); fa.addArc("3", "5", "c", ""); fa.addArc("4", "6", "c", ""); fa.addArc("5", "6", "c", ""); fa.setEndNode("6"); System.out.println(fa); ExactAutomatonMinimizer minimizer = new ExactAutomatonMinimizer(); System.out.println(minimizer.minimizeFA(fa)); System.out.println("Starting..."); Timing.startTime(); TransducerGraph randomFA = TransducerGraph.createRandomGraph(100, 10, 1.0, 10, new ArrayList()); TransducerGraph minimizedRandomFA = minimizer.minimizeFA(randomFA); System.out.println(randomFA); System.out.println(minimizedRandomFA); Timing.tick("done. ( " + randomFA.getArcs().size() + " arcs to " + minimizedRandomFA.getArcs().size() + " arcs)"); }
TransducerGraph randomFA = TransducerGraph.createRandomGraph(5000, 5, 1.0, 5, pathList); List outputs = randomFA.getPathOutputs(pathList);
/** * For testing only. */ public static void main(String[] args) { List pathList = new ArrayList(); TransducerGraph graph = createRandomGraph(1000, 10, 0.0, 10, pathList); System.out.println("Done creating random graph"); printPathOutputs(pathList, graph, true); System.out.println("Depth first search from start node"); StringBuilder b = new StringBuilder(); graph.depthFirstSearch(true, b); System.out.println(b.toString()); b = new StringBuilder(); System.out.println("Depth first search back from end node"); graph.depthFirstSearch(false, b); System.out.println(b.toString()); }
/** * For testing only. */ public static void main(String[] args) { List pathList = new ArrayList(); TransducerGraph graph = createRandomGraph(1000, 10, 0.0, 10, pathList); System.out.println("Done creating random graph"); printPathOutputs(pathList, graph, true); System.out.println("Depth first search from start node"); StringBuffer b = new StringBuffer(); graph.depthFirstSearch(true, b); System.out.println(b.toString()); b = new StringBuffer(); System.out.println("Depth first search back from end node"); graph.depthFirstSearch(false, b); System.out.println(b.toString()); }
/** * For testing only. */ public static void main(String[] args) { List pathList = new ArrayList(); TransducerGraph graph = createRandomGraph(1000, 10, 0.0, 10, pathList); System.out.println("Done creating random graph"); printPathOutputs(pathList, graph, true); System.out.println("Depth first search from start node"); StringBuilder b = new StringBuilder(); graph.depthFirstSearch(true, b); System.out.println(b.toString()); b = new StringBuilder(); System.out.println("Depth first search back from end node"); graph.depthFirstSearch(false, b); System.out.println(b.toString()); }
/** * For testing only. */ public static void main(String[] args) { List pathList = new ArrayList(); TransducerGraph graph = createRandomGraph(1000, 10, 0.0, 10, pathList); System.out.println("Done creating random graph"); printPathOutputs(pathList, graph, true); System.out.println("Depth first search from start node"); StringBuilder b = new StringBuilder(); graph.depthFirstSearch(true, b); System.out.println(b.toString()); b = new StringBuilder(); System.out.println("Depth first search back from end node"); graph.depthFirstSearch(false, b); System.out.println(b.toString()); }
public static void main(String[] args) { TransducerGraph.GraphProcessor qd = new QuasiDeterminizer(); List pathList = new ArrayList(); TransducerGraph graph = TransducerGraph.createRandomGraph(1000, 10, 1.0, 10, pathList); StringBuilder b = new StringBuilder(); graph.depthFirstSearch(true, b); System.out.println(b.toString()); System.out.println("Done creating random graph"); // TransducerGraph.printPathOutputs(pathList, graph, false); //System.out.println("Depth first search from start node"); //TransducerGraph.depthFirstSearch(graph, TransducerGraph.END_NODE, new HashSet(), 0, false); TransducerGraph newGraph = qd.processGraph(graph); System.out.println("Done quasi-determinizing"); //TransducerGraph.printPathOutputs(pathList, newGraph, false); //System.out.println("Depth first search from start node"); //TransducerGraph.depthFirstSearch(newGraph, TransducerGraph.END_NODE, new HashSet(), 0, false); TransducerGraph.testGraphPaths(graph, newGraph, 1000); }
public static void main(String[] args) { TransducerGraph.GraphProcessor qd = new QuasiDeterminizer(); List pathList = new ArrayList(); TransducerGraph graph = TransducerGraph.createRandomGraph(1000, 10, 1.0, 10, pathList); StringBuilder b = new StringBuilder(); graph.depthFirstSearch(true, b); System.out.println(b.toString()); System.out.println("Done creating random graph"); // TransducerGraph.printPathOutputs(pathList, graph, false); //System.out.println("Depth first search from start node"); //TransducerGraph.depthFirstSearch(graph, TransducerGraph.END_NODE, new HashSet(), 0, false); TransducerGraph newGraph = qd.processGraph(graph); System.out.println("Done quasi-determinizing"); //TransducerGraph.printPathOutputs(pathList, newGraph, false); //System.out.println("Depth first search from start node"); //TransducerGraph.depthFirstSearch(newGraph, TransducerGraph.END_NODE, new HashSet(), 0, false); TransducerGraph.testGraphPaths(graph, newGraph, 1000); }
public static void main(String[] args) { TransducerGraph.GraphProcessor qd = new QuasiDeterminizer(); List pathList = new ArrayList(); TransducerGraph graph = TransducerGraph.createRandomGraph(1000, 10, 1.0, 10, pathList); StringBuilder b = new StringBuilder(); graph.depthFirstSearch(true, b); System.out.println(b.toString()); System.out.println("Done creating random graph"); // TransducerGraph.printPathOutputs(pathList, graph, false); //System.out.println("Depth first search from start node"); //TransducerGraph.depthFirstSearch(graph, TransducerGraph.END_NODE, new HashSet(), 0, false); TransducerGraph newGraph = qd.processGraph(graph); System.out.println("Done quasi-determinizing"); //TransducerGraph.printPathOutputs(pathList, newGraph, false); //System.out.println("Depth first search from start node"); //TransducerGraph.depthFirstSearch(newGraph, TransducerGraph.END_NODE, new HashSet(), 0, false); TransducerGraph.testGraphPaths(graph, newGraph, 1000); }
public static void main(String[] args) { TransducerGraph.GraphProcessor qd = new QuasiDeterminizer(); List pathList = new ArrayList(); TransducerGraph graph = TransducerGraph.createRandomGraph(1000, 10, 1.0, 10, pathList); StringBuffer b = new StringBuffer(); graph.depthFirstSearch(true, b); System.out.println(b.toString()); System.out.println("Done creating random graph"); // TransducerGraph.printPathOutputs(pathList, graph, false); //System.out.println("Depth first search from start node"); //TransducerGraph.depthFirstSearch(graph, TransducerGraph.END_NODE, new HashSet(), 0, false); TransducerGraph newGraph = qd.processGraph(graph); System.out.println("Done quasi-determinizing"); //TransducerGraph.printPathOutputs(pathList, newGraph, false); //System.out.println("Depth first search from start node"); //TransducerGraph.depthFirstSearch(newGraph, TransducerGraph.END_NODE, new HashSet(), 0, false); TransducerGraph.testGraphPaths(graph, newGraph, 1000); }
TransducerGraph randomFA = TransducerGraph.createRandomGraph(5000, 5, 1.0, 5, pathList); List outputs = randomFA.getPathOutputs(pathList);
TransducerGraph randomFA = TransducerGraph.createRandomGraph(5000, 5, 1.0, 5, pathList); List outputs = randomFA.getPathOutputs(pathList);
TransducerGraph randomFA = TransducerGraph.createRandomGraph(5000, 5, 1.0, 5, pathList); List outputs = randomFA.getPathOutputs(pathList);
TransducerGraph randomFA = TransducerGraph.createRandomGraph(5000, 5, 1.0, 5, pathList); List outputs = randomFA.getPathOutputs(pathList);