# 遍历每一行文字
for i in range(len(lines)):
current_line = lines
# 检查当前行与其他行是否有重复部分
for j in range(i+1, len(lines)):
other_line = lines[j]
# 检查是否有超过5个字的重复部分
for k in range(len(current_line)-5):
if current_line[k:k+5] in other_line:
repeated_text[current_line[k:k+5]] = repeated_text.get(current_line[k:k+5], 0) + 1
# 找到出现次数超过1的重复文本
for text, count in repeated_text.items():
if count > 1:
print("重复文本:", text)
# 标记出重复文本所在的行
for i in range(len(lines)):
if text in lines:
print("行号:", i+1)