Package cc.mallet.fst

Examples of cc.mallet.fst.Transducer$Incrementor


  public static int numMaxViterbi = 5;

  private static void outputLatticeRows (PrintWriter out, MaxLattice lattice, int start, int end)
  {
    DecimalFormat f = new DecimalFormat ("0.##");
    Transducer ducer = lattice.getTransducer ();
    int max = Math.min (numMaxViterbi, ducer.numStates());
    List<Sequence<Transducer.State>> stateSequences = lattice.bestStateSequences(max);
    for (int k = 0; k < max; k++) {
      out.println ("  <tr class=\"delta\">");
      out.println ("    <td class=\"label\">&delta; rank "+k+"</td>");
      for (int ip = start; ip < end; ip++) {
View Full Code Here


  }


  private static void outputTransitionCosts (PrintWriter out, ExtorInfo info, int start, int end)
  {
    Transducer ducer = info.lattice.getTransducer ();

    out.println ("<tr class=\"predtrans\">");
    out.println ("<td class=\"label\">Cost(pred. trans)</td>");
    for (int ip = start; ip < end; ip++) {
      if (ip == 0) {
View Full Code Here


  private static void outputLatticeRows (PrintWriter out, SumLatticeDefault lattice, int start, int end)
  {
    DecimalFormat f = new DecimalFormat ("0.##");
    Transducer ducer = lattice.getTransducer ();
    for (int k = 0; k < ducer.numStates(); k++) {
      Transducer.State state = ducer.getState (k);
      out.println ("  <tr class=\"alpha\">");
      out.println ("    <td class=\"label\">&alpha;("+state.getName()+")</td>");
      for (int ip = start; ip < end; ip++) {
          out.print ("<td>"+f.format (lattice.getAlpha (ip+1, state))+"</td>");
      }
      out.println ("</tr>");
    }
    for (int k = 0; k < ducer.numStates(); k++) {
      Transducer.State state = ducer.getState (k);
      out.println ("  <tr class=\"beta\">");
      out.println ("    <td class=\"label\">&beta;("+state.getName()+")</td>");
      for (int ip = start; ip < end; ip++) {
          out.print ("<td>"+f.format (lattice.getBeta (ip+1, state))+"</td>");
      }
      out.println ("</tr>");
    }
    for (int k = 0; k < ducer.numStates(); k++) {
      Transducer.State state = ducer.getState (k);
      out.println ("  <tr class=\"gamma\">");
      out.println ("    <td class=\"label\">&gamma;("+state.getName()+")</td>");
      for (int ip = start; ip < end; ip++) {
          out.print ("<td>"+f.format (lattice.getGammaWeight(ip+1, state))+"</td>");
      }
View Full Code Here

TOP

Related Classes of cc.mallet.fst.Transducer$Incrementor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.