顺便说一下,我正在使用python3.4。
@alvas的回答奏效了。但是当我随机使用它时,它会产生一个错误。看一看。nn = {word for word, pos in brown.tagged_words() if pos.startswith('NN')}输出是
{'such', 'ratherFile "/home/aziz/Desktop/2222.py", line 5, in <m
当一个按钮被点击时,它应该突出显示列表中的所有单词。/Reuben_2/AppData/Local/Programs/Python/Python36/Writing is hard/MyHighlighter.py", line 54, in highlight_textpos = ArticleTextBox.search(names[2], pos, stopindex=END, count=lenght)