!7 enum EType { speakStart, speakEnd, heard, typed } sclass Event { long date; EType type; S text; S voice; *() {} *(long *date, EType *type, S *text) {} *(long *date, EType *type, S *text, S *voice) {} } static TailFile tail1, tail2; static Map events = synchroTreeMap(); p-experiment { tail1 = tailFileLinewiseFromStart(cereprocLog(), 100, voidfunc(S line) { if ((line = forceProperUnquote(line)) == null) ret; Pair p = splitAtFirstSpace(line); long date = parseLong(p.a); Map map = unstructureMap(p.b); print(date + ": " + sfu(map)); putLongUnique(events, date, new Event(date, swic(getString(map, 'action), "Begin") ? EType.speakStart : EType.speakEnd, getString(map, 'text), getString(map, 'voice))); }); tail2 = tailFileLinewiseFromStart(speechRecognitionLog(), 100, voidfunc(S line) { if ((line = forceProperUnquote(line)) == null) ret; int i = indexOf(line, '['); long date = parseLongOpt(trim(takeFirst(line, i))); if (date == 0) ret; Pair p = splitSquareBracketStuff(substring(line, i)); print("[heard at " + date + "]: " + p.a + ": " + p.b); putLongUnique(events, date, new Event(date, cic(p.a, "typed") ? EType.typed : EType.heard, p.b)); }); waitUntilAllTailsHaveIdled(tail1, tail2); print("Have " + n(events, "event")); print(takeLast(10, valuesList(events))); }