Warning: session_start(): open(/var/lib/php/sessions/sess_ilao65gh7mur9gc51cirsovs87, 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
concept WordInfo {
S word;
int position;
S fact, wordType;
}
cmodule InfoAboutWords > DynCRUD {
S text, comment;
visualize {
ret northCenterAndSouthWithMargins(
jSection("Input Text", fontSizePlus(2, dm_centeredTextField('text))),
jSection("Facts", super.visualize()),
jSection("Tell me something about a word:", dm_textFieldAndSubmit('comment, 'submitComment)));
}
void submitComment {
S word = firstWord(comment);
int i = indexOfIC_fullWord(text, word);
if (i < 0) ret with print(quote(word) + " not found in sentence");
new Matches m;
if (match_vbar("* is an adjective|* is an adjective here", comment, m))
cset(uniq_sync(WordInfo, +word, position := i), wordType := "adjective");
else
uniq_sync(WordInfo, +word, position := i, fact := comment);
}
}