GrammarCompactor.writeFile(result, "unminimized", key); result = normalizer.processGraph(result); // normalize it so that exact minimization works properly result = quasiDeterminizer.processGraph(result); // push probabilities left or down result = new TransducerGraph(result, ocp); // combine outputs into inputs
TransducerGraph.ArcProcessor ocp = new TransducerGraph.OutputCombiningProcessor(); TransducerGraph detGraph = quasiDeterminizer.processGraph(randomFA); TransducerGraph combGraph = new TransducerGraph(detGraph, ocp); // combine outputs into inputs
TransducerGraph.ArcProcessor ocp = new TransducerGraph.OutputCombiningProcessor(); TransducerGraph detGraph = quasiDeterminizer.processGraph(randomFA); TransducerGraph combGraph = new TransducerGraph(detGraph, ocp); // combine outputs into inputs
TransducerGraph.ArcProcessor ocp = new TransducerGraph.OutputCombiningProcessor(); TransducerGraph detGraph = quasiDeterminizer.processGraph(randomFA); TransducerGraph combGraph = new TransducerGraph(detGraph, ocp); // combine outputs into inputs
TransducerGraph.ArcProcessor ocp = new TransducerGraph.OutputCombiningProcessor(); TransducerGraph detGraph = quasiDeterminizer.processGraph(randomFA); TransducerGraph combGraph = new TransducerGraph(detGraph, ocp); // combine outputs into inputs
@Override protected TransducerGraph doCompaction(TransducerGraph graph, List l1, List l3) { TransducerGraph result = graph; if (saveGraphs) { writeFile(result, "unminimized", (String) result.getEndNodes().iterator().next()); } result = quasiDeterminizer.processGraph(result); result = new TransducerGraph(result, ocp); // combine outputs into inputs result = minimizer.minimizeFA(result); // minimize the thing //result = new TransducerGraph(graph, otsp); // for debugging result = new TransducerGraph(result, ntsp); // pull out strings from sets returned by minimizer result = new TransducerGraph(result, isp); // split outputs from inputs if (saveGraphs) { writeFile(result, "exactminimized", (String) result.getEndNodes().iterator().next()); } // for debugging do comparison of the paths accepted by graph and result //System.err.println(TransducerGraph.testGraphPaths(graph, result, 100)); return result; }
@Override protected TransducerGraph doCompaction(TransducerGraph graph, List l1, List l3) { TransducerGraph result = graph; if (saveGraphs) { writeFile(result, "unminimized", (String) result.getEndNodes().iterator().next()); } result = quasiDeterminizer.processGraph(result); result = new TransducerGraph(result, ocp); // combine outputs into inputs result = minimizer.minimizeFA(result); // minimize the thing //result = new TransducerGraph(graph, otsp); // for debugging result = new TransducerGraph(result, ntsp); // pull out strings from sets returned by minimizer result = new TransducerGraph(result, isp); // split outputs from inputs if (saveGraphs) { writeFile(result, "exactminimized", (String) result.getEndNodes().iterator().next()); } // for debugging do comparison of the paths accepted by graph and result //log.info(TransducerGraph.testGraphPaths(graph, result, 100)); return result; }
@Override protected TransducerGraph doCompaction(TransducerGraph graph, List l1, List l3) { TransducerGraph result = graph; if (saveGraphs) { writeFile(result, "unminimized", (String) result.getEndNodes().iterator().next()); } result = quasiDeterminizer.processGraph(result); result = new TransducerGraph(result, ocp); // combine outputs into inputs result = minimizer.minimizeFA(result); // minimize the thing //result = new TransducerGraph(graph, otsp); // for debugging result = new TransducerGraph(result, ntsp); // pull out strings from sets returned by minimizer result = new TransducerGraph(result, isp); // split outputs from inputs if (saveGraphs) { writeFile(result, "exactminimized", (String) result.getEndNodes().iterator().next()); } // for debugging do comparison of the paths accepted by graph and result //System.err.println(TransducerGraph.testGraphPaths(graph, result, 100)); return result; }
@Override protected TransducerGraph doCompaction(TransducerGraph graph, List l1, List l3) { TransducerGraph result = graph; if (saveGraphs) { writeFile(result, "unminimized", (String) result.getEndNodes().iterator().next()); } result = quasiDeterminizer.processGraph(result); result = new TransducerGraph(result, ocp); // combine outputs into inputs result = minimizer.minimizeFA(result); // minimize the thing //result = new TransducerGraph(graph, otsp); // for debugging result = new TransducerGraph(result, ntsp); // pull out strings from sets returned by minimizer result = new TransducerGraph(result, isp); // split outputs from inputs if (saveGraphs) { writeFile(result, "exactminimized", (String) result.getEndNodes().iterator().next()); } // for debugging do comparison of the paths accepted by graph and result //log.info(TransducerGraph.testGraphPaths(graph, result, 100)); return result; }
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); }
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); }
TransducerGraph.ArcProcessor ocp = new TransducerGraph.OutputCombiningProcessor(); TransducerGraph detGraph = quasiDeterminizer.processGraph(randomFA); TransducerGraph combGraph = new TransducerGraph(detGraph, ocp); // combine outputs into inputs
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); }
@Override protected TransducerGraph doCompaction(TransducerGraph graph, List l1, List l3) { TransducerGraph result = graph; if (saveGraphs) { writeFile(result, "unminimized", (String) result.getEndNodes().iterator().next()); } result = quasiDeterminizer.processGraph(result); result = new TransducerGraph(result, ocp); // combine outputs into inputs result = minimizer.minimizeFA(result); // minimize the thing //result = new TransducerGraph(graph, otsp); // for debugging result = new TransducerGraph(result, ntsp); // pull out strings from sets returned by minimizer result = new TransducerGraph(result, isp); // split outputs from inputs if (saveGraphs) { writeFile(result, "exactminimized", (String) result.getEndNodes().iterator().next()); } // for debugging do comparison of the paths accepted by graph and result //log.info(TransducerGraph.testGraphPaths(graph, result, 100)); return result; }