fix text splitter (#22596)
This commit is contained in:
parent
d37b6716cd
commit
ed263aed9f
1 changed files with 1 additions and 0 deletions
|
|
@ -102,6 +102,7 @@ class FixedRecursiveCharacterTextSplitter(EnhanceRecursiveCharacterTextSplitter)
|
||||||
splits = text.split()
|
splits = text.split()
|
||||||
else:
|
else:
|
||||||
splits = text.split(separator)
|
splits = text.split(separator)
|
||||||
|
splits = [item + separator if i < len(splits) else item for i, item in enumerate(splits)]
|
||||||
else:
|
else:
|
||||||
splits = list(text)
|
splits = list(text)
|
||||||
splits = [s for s in splits if (s not in {"", "\n"})]
|
splits = [s for s in splits if (s not in {"", "\n"})]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue