最复杂的就是这一行了:(word for word in jieba.cut(line,hmm=true)if word not in stop and len(word.strip())>1)jieba.cut(line)将一行字符串,分割成一个个单词word for word in jieba.cut(line,hmm=true)是一个python的表理解,相当于for循环遍历分割好的一个个单词if word not in stop and len(word.strip())>1这仍然是表理解的一部分,如果满足条件,就把单词加入到一个新的列表中,如果不满足就丢弃,word not in stop单词不在停用词当中len(word.strip())>1单词去掉首尾的空格、标点符号后的长度大于1。 20210311