Fix: parent-children pipleine bad case. (#12246)

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Kevin Hu
2025-12-26 18:57:16 +08:00
committed by GitHub
parent 613d2c5790
commit bc9e1e3b9a
3 changed files with 18 additions and 14 deletions

View File

@ -92,9 +92,9 @@ class Splitter(ProcessBase):
continue
split_sec = re.split(r"(%s)" % custom_pattern, c, flags=re.DOTALL)
if split_sec:
for txt in split_sec:
for j in range(0, len(split_sec), 2):
docs.append({
"text": txt,
"text": split_sec[j],
"mom": c
})
else:
@ -155,9 +155,9 @@ class Splitter(ProcessBase):
split_sec = re.split(r"(%s)" % custom_pattern, c["text"], flags=re.DOTALL)
if split_sec:
c["mom"] = c["text"]
for txt in split_sec:
for j in range(0, len(split_sec), 2):
cc = deepcopy(c)
cc["text"] = txt
cc["text"] = split_sec[j]
docs.append(cc)
else:
docs.append(c)