You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constnlp=require('compromise')consttext='There are Thirty days in the January Clinic'constdoc=nlp(text)doc.debug()constmatchObjects=[{match:
'(One|Two|Three|Four|Five|Six|Seven|Eight|Nine|Ten|Eleven|Twelve|Thirteen|Fourteen|Fifteen|Sixteen|Seventeen|Eighteen|Nineteen|Twenty|Thirty|Forty|Fifty|Sixty|Seventy|Eighty|Ninety|Hundred)',reason: 'Capitalisation',tag: 'Value',},{match: '(January|February|March|April|May|June|July|August|September|October|November|December)',reason: '',tag: 'Month',unTag: 'ProperNoun',},{match: 'Clinic',reason: '',unTag: 'ProperNoun',},// ❌ these rules get ignored?{match: 'Clinic',reason: '',unTag: 'Person',},{match: '(January|February|March|April|May|June|July|August|September|October|November|December)',reason: '',unTag: 'Person',},]constnet=nlp.buildNet(matchObjects)doc.sweep(net)doc.debug()
Is it possible to
unTag
multiple tags when using a match object andsweep()
?You can see in the example below that
unTag
works the first time it's used but is ignored for the samematch
when used on subsequent tagsI want the months and
clinic
tounTag: 'Person'
but it's ignored.I have tried variants:
Reproduce Issue:
Output:
The text was updated successfully, but these errors were encountered: