Skip to content

[FEATURE] Create a simple SplitBySeparators function (don't account chunk size) #1003

@georgeh0

Description

@georgeh0

Today we have a function SplitRecursively which consider both chunk size and separators during splitting.

Sometimes users may need a simpler behavior: just split by specified separators without considering chunk size.
For example, when users specify \n\n+, it simply split the text into paragraphs (considering paragraphs always separated by empty lines in between).

You can look into the existing implementation of SplitRecursively for the overall structure, but this SplitBySeparators will be much simpler.


❤️ Contributors, please refer to 📙Contributing Guide.
Unless the PR can be sent immediately (e.g. just a few lines of code), we recommend you to leave a comment on the issue like I'm working on it or Can I work on this issue? to avoid duplicating work. Our Discord server is always open and friendly.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions