SenoneHMM hmm = (SenoneHMM)hmm0;
if (hmm.isContextDependent()) {
continue;
}
Unit unit = hmm.getUnit();
String name = unit.getName();
pw.print(name + '\t');
String left = "-";
pw.print(left + " ");
String right = "-";
pw.print(right + ' ');
String position = hmm.getPosition().toString();
pw.print(position + '\t');
String attribute = unit.isFiller() ? FILLER : "n/a";
pw.print(attribute + '\t');
int tmat = matrixPool.indexOf(hmm.getTransitionMatrix());
assert tmat < numTiedTransitionMatrices;
pw.print(tmat + "\t");
SenoneSequence ss = hmm.getSenoneSequence();
Senone[] senones = ss.getSenones();
for (Senone senone : senones) {
int index = senonePool.indexOf(senone);
assert index >= 0 && index < numContextIndependentTiedState;
pw.print(index + "\t");
}
pw.println("N");
if (logger.isLoggable(Level.FINE)) {
logger.fine("Saved " + unit);
}
}
// Save the context dependent phones.
for (HMM hmm0 : hmmManager) {
SenoneHMM hmm = (SenoneHMM)hmm0;
if (!hmm.isContextDependent()) {
continue;
}
Unit unit = hmm.getUnit();
LeftRightContext context = (LeftRightContext)unit.getContext();
Unit[] leftContext = context.getLeftContext();
Unit[] rightContext = context.getRightContext();
assert leftContext.length == 1 && rightContext.length == 1;
String name = unit.getName();
pw.print(name + '\t');
String left = leftContext[0].getName();
pw.print(left + " ");
String right = rightContext[0].getName();
pw.print(right + ' ');
String position = hmm.getPosition().toString();
pw.print(position + '\t');
String attribute = unit.isFiller() ? FILLER : "n/a";
assert attribute.equals("n/a");
pw.print(attribute + '\t');
int tmat = matrixPool.indexOf(hmm.getTransitionMatrix());
assert tmat < numTiedTransitionMatrices;
pw.print(tmat + "\t");