diff --git a/dsLightRag/ShiTi/T3_DocxToMd.py b/dsLightRag/ShiTi/T3_DocxToMd.py index 53ddd8e9..a9a8f42c 100644 --- a/dsLightRag/ShiTi/T3_DocxToMd.py +++ b/dsLightRag/ShiTi/T3_DocxToMd.py @@ -101,6 +101,15 @@ async def main(): # 干掉空行 if q.strip() == "" or q == '\n': continue + # 如果q是以 question_types 中某个字符开头的,则在完成这个字符串后,换行输出 + for x in question_types: + if q.startswith(x): + q= q.replace(" ","") + # q的x后面第一个字符是不是换行符\n,如果 不是,则添加一个\n + if q[q.index(x) + len(x)] != '\n': + q = q.replace(x, x + '\n') + break + q='【题型】'+q print(q) print("\n")