-
Notifications
You must be signed in to change notification settings - Fork 15.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix markdown text splitter horizontal lines #5625
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this! MO more future proof solution is to use re.escape on all language separators
@devstein, I appreciate your suggestion, but using re.escape would also escape the '' character in '\n', which isn't the intended behavior. It's important to note that these strings are regular expressions, so they should be explicitly defined for the sake of clarity and to better comprehend their functionality. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add a test for this?
@hwchase17 I added a test for markdown. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks
Fixes langchain-ai#5614 #### Issue The `***` combination produces an exception when used as a seperator in `re.split`. Instead `\*\*\*` should be used for regex exprations. #### Who can review? @eyurtsev
Fixes #5614
Issue
The
***
combination produces an exception when used as a seperator inre.split
. Instead\*\*\*
should be used for regex exprations.Who can review?
@eyurtsev