const nlp=require('compromise')
let doc=nlp('i am Mr. John A. Smith.')
// loop through each individual term object
doc.terms().list.forEach(ts=>{
let term = ts.terms[0]
if(term.tags.Abbreviation || term.tags.Acronym){
term.text = term.text.replace(/\.$/, '')
}
})
doc.out()