|
for line in text_file:
#sentence = line.decode('utf-8') #将每行中文文本做编码处理
line = line.strip()
sentence = line.decode('utf-8') #将每行中文文本做编码处理
#seg_list = jieba.cut(sentence, cut_all = False) #中文分词
lstr = list(jieba.cut(sentence, cut_all=False)) #将分词结果保存在list中
temp_col_count = len(lstr)
if temp_col_count > max_col_count:
max_col_count = temp_col_count
row = row + 1
max_row_count = row
Arraylist_WordCut = [[0 for col1 in range(max_col_count)] for row1 in range(max_row_count)]
for line1 in text_file:
sentence1 = line.decode('utf-8') #将每行中文文本做编码处理
#seg_list = jieba.cut(sentence, cut_all = False) #中文分词
lstr1 = list(jieba.cut(sentence1, cut_all=False)) #将分词结果保存在list
for j in range(len(lstr1)):
Arraylist_WordCut[temp_row_count][j] = lstr1[j]
temp_row_count = temp_row_count + 1
为何第二个for循环总是进不去,很奇怪,求帮助!!
|
|