code: private static void augment(AugmentLabels label, MutableFst fst, Semiring semiring, String eps1, String eps2) {
      // label: 0->augment on ilabel
      // 1->augment on olabel
  
      int e1inputIndex = fst.getInputSymbols().getOrAdd(eps1);
      int e2inputIndex = fst.getInputSymbols().getOrAdd(eps2);
  
      int e1outputIndex = fst.getOutputSymbols().getOrAdd(eps1);
      int e2outputIndex = fst.getOutputSymbols().getOrAdd(eps2);
  
      int iEps = fst.getInputSymbols().get(Fst.EPS);
      int oEps = fst.getOutputSymbols().get(Fst.EPS);
  
      int numStates = fst.getStateCount();
      for (int i = 0; i < numStates; i++) {
        MutableState s = fst.getState(i);
        for (MutableArc arc : s.getArcs()) {
          if ((label == AugmentLabels.OUTPUT) && (arc.getOlabel() == oEps)) {
            arc.setOlabel(e2outputIndex);
          } else if ((label == AugmentLabels.INPUT) && (arc.getIlabel() == iEps)) {
            arc.setIlabel(e1inputIndex);
          }
        }
        if (label == AugmentLabels.INPUT) {
          fst.addArc(s, e2inputIndex, oEps, s, semiring.one());
        } else if (label == AugmentLabels.OUTPUT) {
          fst.addArc(s, iEps, e1outputIndex, s, semiring.one());
        }
      }
    }
docs: Augments the labels of an Fst in order to use it for composition avoiding multiple epsilon paths in the resulting
  Fst
  
  @param label constant denoting if the augment should take place on input or output labels For value equal to 0
  augment will take place for input labels For value equal to 1 augment will take place for output
  labels
  @param fst   the fst to augment