-
Notifications
You must be signed in to change notification settings - Fork 660
Open
Description
I'd like to be able to define custom tags that are applied only if their allowed parts of speech are respected. It looks like the plugin interface tries to support that, but it doesn't seem to be working. Wondering if this is a bug, feature request, or if there's another way to accomplish this. Here's what I tried:
nlp.plugin({
tags: {
Employee: {
also: ['ProperNoun'],
not: ['Verb', 'Adverb', 'Adjective'],
},
},
words: {
will: 'Employee',
},
})
nlp('Will is an employee').match('#Employee') // Matches like I expect.
nlp('I will go to the store').match('#Employee') // Matches, but I expected not to match since "will" is used as a verb and "Employee" is defined not to be a verb.