Warning: session_start(): open(/var/lib/php/sessions/sess_go4eqi6acdr8f95lkvevjvtskk, 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
beaConcept BPattern {
S text;
toString { ret "[\*id*/] " + shortDynName(this) + " " + quote(text); }
void reactWith(BInput input, IBEAReactor reactor) {}
@Override Map _fieldMigrations() {
ret litmap(pattern := new FieldMigration("text"));
}
}
beaConcept BStarPattern > BPattern {
void reactWith(BInput input, IBEAReactor reactor) {
LS mapping = matchesToStringList(flexMatchIC_first(text, input.text));
if (mapping == null) ret;
reactor.uniqResult(BEAObject,
type := "match",
+input,
pattern := this,
+mapping);
}
}
beaConcept BAngleVarPattern > BPattern {
void reactWith(BInput input, IBEAReactor reactor) {
SS mapping = flexMatchAngleBracketVarsIC_first(text, input.text);
if (mapping == null) ret;
reactor.uniqResult(BEAObject,
type := "match",
+input,
pattern := this,
+mapping);
}
}
beaConcept BMatch {
new Ref pattern;
SS mapping;
}
beaConcept BMatchToScenario {
void reactWith(BMatch match, IBEAReactor reactor) {
reactor.uniqResult(BEAObject,
type := "scenario",
text := mapToLines(match.mapping,
(a, b) -> format_curly("* is a *.", b, a));
}
}
beaConcept BScenarioToOutput {
bool canReactWith(BEAObject o) {
ret o.typeIs("scenario");
}
void reactWith(BEAObject scenario, IBEAReactor reactor) {
reactor.uniqResult(BOutput,
type := "Output",
text := getString text(scenario));
}
}
cmodule2 > DynBEAReactor_textInOut {
S input = "UBports community delivers 'second-largest release of Ubuntu Touch ever'", output;
void createInitialObjects {
uniq BMatchToScenario();
uniq BScenarioToOutput();
//uniq BPattern(text := "* delivers *");
uniq BAngleVarPattern(text := " delivers ");
}
}