def extract_terms_from_file(file_location, stopwords=None, lemmatize=None, stem=None, only_N_J=None):
with open(file_location, 'r', encoding='iso-8859-1') as doc:
terms = []
for line in doc:
terms.extend(re.compile('\w+').findall(line.lower()))
# terms = re.compile('\w+').findall(doc
# .read()
# .replace('\n', '')
# .lower())
return clean_terms(terms, stopwords, lemmatize, stem, only_N_J)
graph_of_words.py 文件源码
python
阅读 20
收藏 0
点赞 0
评论 0
评论列表
文章目录