-
Notifications
You must be signed in to change notification settings - Fork 305
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: move paragraph separation back to two newlines #904
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: 32bd990 The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
// many documents will use it. | ||
// NOTE this is different from Python because in Python a lot of the heavy lifting for paragraph separation | ||
// is already handled by NLTK, but we don't have that option here. | ||
export const defaultParagraphSeparator = /\n\n|\r\n\r\n|\r\r/g; |
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.
This way we decouple the document encoding from the OS that the user is currently running on.
].join( | ||
typeof this.paragraphSeparator === "string" | ||
? this.paragraphSeparator | ||
: "\n\n", |
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.
\n\n
works for all envs?
@@ -55,10 +53,9 @@ export function cjkSentenceTokenizer(sentence: string): string[] { | |||
return slist.filter((s) => s.length > 0); | |||
} | |||
|
|||
export const defaultParagraphSeparator = EOL + EOL + EOL; |
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.
wasn't the problem that we're not using export const defaultParagraphSeparator = EOL + EOL
?
No description provided.