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) {}
}
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 := scenario~.text);
}
}
module > DynBEAReactor_textInOut {
{ input = "UBports community delivers 'second-largest release of Ubuntu Touch ever'"; }
start {
crud.showClassNameSelectors = true;
crud.allowNewFields = true;
crud.emptyStringsToNull = true;
}
void createInitialObjects {
uniq BMatchToScenario();
uniq BScenarioToOutput();
//uniq BPattern(text := "* delivers *");
uniq BAngleVarPattern(text := " delivers ");
}
}