direct term-regex

node v10.24.1
version: master
endpointsharetweet
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()
Loading…

no comments

    sign in to comment