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
Below example tags { word: [ 'Value', 'TestB' ] } ] where { word: [ 'Value', 'TestA', 'TestB' ] } ] is expected.
nlp.world() shows that both hooks are in the array but only the last one is applied.
hey Frederik, yeah the hooks are 'stringly-typed' so they must be unique - we just loop through them and run .compute(str) on each one, so you'll have to make the names unique.
I'm curious about your application - why make the multiple plugins? I'm happy to help talk-through it. I also love to see how the plugin stuff is received in the wild. Let me know what you're trying to achieve, if you'd like.
cheers
I'll explain my reasoning. I was doing a POC on identifying parts of a text document (example below). Since these were different problem domains, I called the first one authors and the last one references to detect strings that are likely a list of authors or a list of references. The reasoning behind having two plugins was to be able to test them individually and being able to replace them like that as well.
The person, org detection came in quite handy since I will extract the entities in a second step.
It's not a problem for me to name hooks differently, I probably just misunderstood the concept of them.
Thanks for this awesome library!
I am running a simple setup with two plugins. Following the examples on https://observablehq.com/@spencermountain/compromise-constructor-methods I named my hooks 'postProcess'. However, it seems that a later hook overrides the behavior of the first one.
Below example tags
{ word: [ 'Value', 'TestB' ] } ]
where{ word: [ 'Value', 'TestA', 'TestB' ] } ]
is expected.nlp.world() shows that both hooks are in the array but only the last one is applied.
npl.world output (for version 14.13.0):
If this is expected behavior, maybe a mention in the docs would be good. In any case the hooks should probably not be stored twice then.
The text was updated successfully, but these errors were encountered: