smolsdb
v1.0.0
Published
Split text into sentences using vanilla sentence boundary detection (SBD) algorithm
Maintainers
Readme
Smol Sentence Boundary Detection (SBD)
Tiny 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.
Installation
The package is available on npm:
npm install smolsdbUsage
Import the sentences function and pass a string to it. It will return an array of sentences.
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.",
//=> ]Changelog
See the changelog.
