string-to-sentences

1.0.1 • Public • Published

string-to-sentences

Given a string, split it and return all sentences

  • Install using "npm install string-to-sentences" or "yarn add string-to-sentences"
import Sentences from 'string-to-sentences';

const text = 'I am sentence 1. I am sentence 2?';
// with punctuation
const sentences = Sentences.getSentences(text);
// results in ['I am sentence 1.', 'I am sentence 2?']

// without punctuation
const sentences = Sentences.getSentences(text, { removePunctuation: true });
// results in ['I am sentence 1', 'I am sentence 2']

Readme

Keywords

none

Package Sidebar

Install

npm i string-to-sentences

Weekly Downloads

3

Version

1.0.1

License

ISC

Unpacked Size

96.1 kB

Total Files

5

Last publish

Collaborators

  • toitsss