MCPcopy Create free account
hub / github.com/Dod-o/Statistical-Learning-Method_Code / loadArticle

Function loadArticle

HMM/HMM.py:145–162  ·  view source on GitHub ↗

加载文章 :param fileName:文件路径 :return: 文章内容

(fileName)

Source from the content-addressed store, hash-verified

143 return PI, A, B
144
145def loadArticle(fileName):
146 '''
147 加载文章
148 :param fileName:文件路径
149 :return: 文章内容
150 '''
151 #初始化文章列表
152 artical = []
153 #打开文件
154 fr = open(fileName, encoding='utf-8')
155 #按行读取文件
156 for line in fr.readlines():
157 #读到的每行最后都有一个\n,使用strip将最后的回车符去掉
158 line = line.strip()
159 #将该行放入文章列表中
160 artical.append(line)
161 #将文章返回
162 return artical
163
164def participle(artical, PI, A, B):
165 '''

Callers 1

HMM.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected