!7 sclass Line { S text, interpretation; sS _fieldOrder = "text interpretation"; } cmodule SimpleWikipediaSentences > DynTableWithInput { S topic; start { set fieldsInOrder; } afterVisualize { tablePopupMenuItem(table(), "Ignore", rThread ignoreLine); } void update(S topic) { topic = trim(topic); setField(+topic); setModuleName(topic + " - Simple Wikipedia"); L data = cloneList_putInField Line('text, simpleWikipedia_sentencesForTopic(topic)); LPair ignore = dm_gazelle_linesToIgnoreForSimpleWikipediaTopic(topic); for i over data: { Line l = data.get(i); if (contains(ignore, pair(l.text, i))) l.interpretation = 'ignore; } setData(data); } void ignoreLine { int i = selectedIndex(); Line line = selected(); if (line == null) ret; LS context = collect text(subList(data(), 0, i)); LS comments = ll( "out = action", "from simple wikipedia topic " + optQuote(topic), "previous lines = " + quote(lines_rtrim(context))); dm_gazelle_addRuleWithComment(line.text + "\n=> ignore", lines_rtrim(comments)); } }