def __init__(self, stop_words_file=None, allow_speech_tags=util.allow_speech_tags):
        """
        Keyword arguments:
        stop_words_file    -- 保存停止词的文件路径，utf8编码，每行一个停止词。若不是str类型，则使用默认的停止词
        allow_speech_tags  -- 词性列表，用于过滤
        """

        allow_speech_tags = [item for item in allow_speech_tags]

        self.default_speech_tag_filter = allow_speech_tags
        self.stop_words = set()
        self.stop_words_file = get_default_stop_words_file()
        if type(stop_words_file) is str:
            self.stop_words_file = stop_words_file
        for word in codecs.open(self.stop_words_file, 'r', 'utf-8', 'ignore'):
            self.stop_words.add(word.strip())
def __init__ ( self , stop_words_file = None , allow_speech_tags = util . allow_speech_tags ) : allow_speech_tags = [ item for item in allow_speech_tags ] self . default_speech_tag_filter = allow_speech_tags self . stop_words = set ( ) self . stop_words_file = get_default_stop_words_file ( ) if type ( stop_words_file ) is str : self . stop_words_file = stop_words_file for word in codecs . open ( self . stop_words_file , 'r' , 'utf-8' , 'ignore' ) : self . stop_words . add ( word . strip ( ) )
Keyword arguments:
        stop_words_file    -- 保存停止词的文件路径，utf8编码，每行一个停止词。若不是str类型，则使用默认的停止词
        allow_speech_tags  -- 词性列表，用于过滤