def feedback(self): """ Return a dict stating that the memorandum was a text, not a word list; the first line or so of the text; the tokens (words) of the text; the unique words of the text sans the stopwords; the reading time of the text. """ summary = {} summary["Memoranda_type"] = "Text" summary["Text_title"] = self.widget.title summary["Text_abbreviated"] = abbreviate_text(self.widget.text) summary["Text_tokens"] = tokenize(self.widget.text) summary["Text_keywords"] = nonstopword_unique_tokens(tokenize(self.widget.text)) summary["Reading_time"] = self.reading_time return summary
def new(cls, name, title, text, inwords, outwords, start_text_msg, start_memorytest_msg, test_times, reading_times, game_duration=120, game_speed=500): WordRecognitionTestStimuliCheck(strings.tokenize(text), inwords, outwords) text_display = TextDisplay.new(text=text, title=title, start_msg=start_text_msg, **reading_times) tetris = Tetris.new(duration = game_duration, speed = game_speed) word_recognition_test\ = WordRecognitionTest.new(inwords = inwords, outwords = outwords, start_msg = start_memorytest_msg, **test_times) return cls._new( name = name, text_display = text_display, word_recognition_test = word_recognition_test, tetris = tetris)