Warning: session_start(): open(/var/lib/php/sessions/sess_8orgaga686r4eokda7l0nrapep, 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
persistable sclass NLABlock {
S text; // original text
LS lines; // same, split into lines
Set entities; // entities
L parsedLines;
class Line {
S text;
Entity introducedEntity;
L proposition; // fragments
toString {
ret joinWithSpace(proposition)
+ (introducedEntity == null ? "" : " => " + introducedEntity);
}
int index() { ret parsedLines.indexOf(this); }
}
sclass Entity extends Cluster {
S definedInLine;
*(S name, S *definedInLine) { addSynonym(name); }
}
*(S *text) {}
bool isParsed() { ret parsedLines != null; }
toString {
ret !isParsed() ? text : lines_rtrim(parsedLines);
}
L introductions() {
ret filter(parsedLines, line -> line.introducedEntity != null);
}
L propositionLines() {
ret filter(parsedLines, line -> line.introducedEntity == null);
}
Set propositionSet() {
ret collectAsSet proposition(propositionLines());
}
Map propositionIndex() {
ret indexByField proposition(propositionLines());
}
}