Warning: session_start(): open(/var/lib/php/sessions/sess_39uhcofejoq1q2k6g5smbs1m4o, 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
sS data = [[
User: Today I bought a {Big Mac} for 1 €
Bot: Wow... that's cheap! Usually they cost like... how much?
User: 5 €
Bot: Yes, yes. So that's 80% off!
---- Test
User: Today I bought a car for 50 €
Bot: Wow... that's cheap! Usually they cost like... how much?
User: 5000 €
Bot: Yes, yes. So that's 99% off!
]];
p-exp {
SS sections = minusSignSections(data);
F1 tokenize = f javaTokWithBrackets;
LPair pairs = assertNotNull(zipTwoLists_strict(
tlft(sections.get("")),
tlft(sections.get("Test"))));
pnl(pairs);
SS map = ciMap();
for (PairS p : pairs) {
LS tokA = callF(tokenize, p.a), tokB = callF(tokenize, p.b);
if (l(tokA) != l(tokB))
continue with print("Mismatched token count, skipping: " + p);
SS map2 = gazelle_zipTwoTokenizationsToMap(tokA, tokB);
if (map2 == null) continue with warn("line not matchable: " + p);
printIndent(map2);
Set newVars = setMinusSet(keys(map2), keys(map));
print("New vars: " + newVars);
print(" Rule: " + p.a + " => " + joinWithComma(map joinPairWithEquals(mapBoth optCurly(mapToPairs(map2)))));
if (!putAllStrictlyIC(map, map2)) warn("failure to merge maps");
}
print(map);
LS numberKeys = filter isInteger(keys(map));
L numbers = map parseDouble(numberKeys);
S numFunc = null;
if (l(numbers) > 1) {
numFunc = ai_findNumberCalculationFunction1(numbers);
if (numFunc != null) {
print("Found number function: " + numFunc);
LS numberValues = filter isInteger(values(map));
L numbers2 = map parseDouble(numberValues);
if (ai_checkNumberCalculationFunction1(numFunc, numbers2))
print("Number function verifies.");
else {
print("Number function doesn't verify.");
numFunc = null;
}
}
}
}