Split text into sentences using vanilla sentence boundary detection (SBD) algorithm
npm install smolsdbTiny sentence boundary detection library for JavaScript/TypeScript.
It uses the vanilla strategy covering ~95% of cases.
This is modernized and trimmed fork of Fabiën Tesselaar's sbd. Unlike the original version, it is focused on the single task and removes extra options.
The package is available on npm:
``sh`
npm install smolsdb
Import the sentences function and pass a string to it. It will return an array of sentences.
`ts
import { sentences } from "smolsdb";
sentences(
"On Jan. 20, former Sen. Barack Obama became the 44th President of the U.S. Millions attended the Inauguration.",
);
//=> [
//=> "On Jan. 20, former Sen. Barack Obama became the 44th President of the U.S.",
//=> "Millions attended the Inauguration.",
//=> ]
``
See the changelog.