Skip to content

Function that tries to split sentences by max size, first by sentence, then by other punctuation.

Notifications You must be signed in to change notification settings

joshuacurtiss/splitsentences

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This function receives some string content and a maximum length, and will break the content into a collection of strings that will fit the maximum length, but prioritizing: (a) sentences, (b) sentence fragments, (c) and lastly, words.

Example

const splitSentences = require('splitsentences');
const hugecontent = 'Blah blah blah.';
console.log(splitSentences(hugecontent,200));

About

Function that tries to split sentences by max size, first by sentence, then by other punctuation.

Resources

Stars

Watchers

Forks

Packages

No packages published