Warning: session_start(): open(/var/lib/php/sessions/sess_ii1quodg4jjec9ls8pagifoid3, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!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));
});
waitUntilAllTailsStarted(tail1, tail2);
print("Have " + n(events, "event"));
print(takeLast(10, valuesList(events)));
}