TextRank4ZH icon indicating copy to clipboard operation
TextRank4ZH copied to clipboard

Fix un-closed file when opening stop_words_file.

Open RUI-LONG opened this issue 2 years ago • 0 comments

Warning detail: ResourceWarning: unclosed file <_io.BufferedReader name='D:\Anaconda\envs\know\lib\site-packages\textrank4zh\stopwords.txt'> for word in codecs.open(self.stop_words_file, 'r', 'utf-8', 'ignore'):

What I have done: Simply called close to stop_words_file.

RUI-LONG avatar Sep 04 '21 14:09 RUI-LONG