result = {
nlp.extend(plugin)
let doc = nlp('i saw John Lennon, and tom cruise.')
doc.people().forEach(m => {
if (m.has('john lennon')) {
m.addPayload({ height: `5'11` })
}
if (m.has('tom cruise')) {
m.addPayload({ height: `5'8` })
}
})
return doc.getPayloads().map(o=>{
return {match:o.match.text(), val:o.val}
})
}