|
@@ -1835,11 +1835,29 @@ def table_head_repair_process(_inner_table, docid=None, show=0, show_row_index=0
|
|
|
inner_table[1][1][1] = 0
|
|
|
return inner_table
|
|
|
|
|
|
+ def repair_by_rank(inner_table):
|
|
|
+ if not inner_table or (inner_table and len(inner_table[0]) < 3):
|
|
|
+ return inner_table
|
|
|
+ for i in range(len(inner_table)):
|
|
|
+ for j in range(len(inner_table[i])-2):
|
|
|
+ if inner_table[i][j][0] in ['第一名'] and inner_table[i][j+1][0] in ['第二名'] and inner_table[i][j+2][0] in ['第三名']:
|
|
|
+ inner_table[i][j][1] = 1
|
|
|
+ inner_table[i][j+1][1] = 1
|
|
|
+ inner_table[i][j+2][1] = 1
|
|
|
+ return inner_table
|
|
|
+
|
|
|
_inner_table = pre_process(_inner_table)
|
|
|
compare_inner_table = copy.deepcopy(_inner_table)
|
|
|
if show:
|
|
|
print('table_head_repair_process1', show_row_index, _inner_table[show_row_index])
|
|
|
|
|
|
+ _inner_table = repair_by_rank(_inner_table)
|
|
|
+ if _inner_table != compare_inner_table:
|
|
|
+ compare_inner_table = copy.deepcopy(_inner_table)
|
|
|
+ log('table_head repair1.5 ' + str(docid))
|
|
|
+ if show:
|
|
|
+ print('table_head_repair_process1.5', show_row_index, _inner_table[show_row_index])
|
|
|
+
|
|
|
_inner_table = repair_by_colon(_inner_table)
|
|
|
if _inner_table != compare_inner_table:
|
|
|
compare_inner_table = copy.deepcopy(_inner_table)
|