string-to-sentences
v1.0.1
Published
Extract sentences from string
Downloads
5
Readme
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']