1.0.1 • Published 6 years ago

string-to-sentences v1.0.1

Weekly downloads
3
License
ISC
Repository
github
Last release
6 years ago

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']