Closed Fdawgs closed 3 months ago
ah, interesting! i can take a look, thanks Frazer
hey Frazer, good find.
This is happening due to the words being naturally un-frozen
after the tagger runs. Here, 'ECG' is being secretly tagged a second time, when new words are appended to the sentence.
in 14.13.0
you can now do .compute('frozen')
, which will re-freeze any tags:
nlp.plugin({
frozen: {
ecg: 'Frozen',
},
})
let doc = nlp('ECG')
doc.compute('frozen')
doc.prepend('For the upcoming visit, the patient will need an ')
doc.match('ecg').has('#Frozen') // true
cheers
Node version: 20.10.0 Compromise version: 14.11.*; 14.12.0
As title states, tags that are previously frozen are removed if the tag is also an #Acronym and is prepended using
.prepend()
.Note in the below examples that 'audiology' and 'assessment' retains the frozen #Diagnostic tag, whilst "ECG" does not.
Reproduction: