Contractions
Convert English contractions to complete words.
Uses the word list from https://en.wikipedia.org/wiki/Wikipedia:List_of_English_contractions.
npm install contractions
var contractions = require('contractions');
console.log(contractions.expand("I don't know who ya'll are."));
console.log(contractions.contract("You all will have not seen this."));
You can also use your own list of contractions / strings.
Note: Longer strings take precedent over short strings.
var Contractions = require('contractions').Contractions;
var contractions = new Contractions({
'asap': 'as soon as possible',
'a.s.a.p.': 'as soon as possible'
});
var text = 'asap';
text = contractions.expand(text);
console.log(text);
text = contractions.contract(text);
console.log(text);