public LazyHmmManager(KaldiTextParser parser, TransitionModel transitionModel, Pool senonePool, Map symbolTable) { this.transitionModel = transitionModel; this.senonePool = senonePool; this.symbolTable = symbolTable; parser.expectToken("ContextDependency"); parser.getInt(); parser.getInt(); parser.expectToken("ToPdf"); this.eventMap = this.parseEventMap(parser); parser.expectToken("EndContextDependency"); }
public KaldiGmmPool(KaldiTextParser parser) : base("senones") { parser.expectToken("<DIMENSION>"); parser.getInt(); parser.expectToken("<NUMPDFS>"); int @int = parser.getInt(); for (int i = 0; i < @int; i++) { this.put(i, new DiagGmm(i, parser)); } }
private EventMap parseTableEventMap(KaldiTextParser kaldiTextParser) { int @int = kaldiTextParser.getInt(); int num = kaldiTextParser.getInt(); ArrayList arrayList = new ArrayList(num); kaldiTextParser.expectToken("("); for (;;) { int num2 = 0; int num3 = num; num--; if (num2 >= num3) { break; } arrayList.add(this.parseEventMap(kaldiTextParser)); } kaldiTextParser.expectToken(")"); return(new TableEventMap(@int, arrayList)); }
private EventMap parseSplitEventMap(KaldiTextParser kaldiTextParser) { int @int = kaldiTextParser.getInt(); ArrayList arrayList = new ArrayList(); int[] intArray = kaldiTextParser.getIntArray(); int num = intArray.Length; for (int i = 0; i < num; i++) { Integer integer = Integer.valueOf(intArray[i]); arrayList.add(integer); } kaldiTextParser.expectToken("{"); EventMap yesMap = this.parseEventMap(kaldiTextParser); EventMap noMap = this.parseEventMap(kaldiTextParser); SplitEventMap result = new SplitEventMap(@int, arrayList, yesMap, noMap); kaldiTextParser.expectToken("}"); return(result); }
private EventMap parseEventMap(KaldiTextParser kaldiTextParser) { string token = kaldiTextParser.getToken(); if (String.instancehelper_equals("CE", token)) { return(new ConstantEventMap(kaldiTextParser.getInt())); } if (String.instancehelper_equals("SE", token)) { return(this.parseSplitEventMap(kaldiTextParser)); } if (String.instancehelper_equals("TE", token)) { return(this.parseTableEventMap(kaldiTextParser)); } if (String.instancehelper_equals("NULL", token)) { return(null); } string text = token; throw new InputMismatchException(text); }