Matcher pattern with NOT_IN and extension attributes #9789
-
I'm trying to write a what I'm trying to achieve is a pattern that matches every sequence of tokens that is not an I tried to write something like the following snippet: nlp = ...
pattern = [{
"OP": "+",
"_": {
"NOT_IN": [{
"end_phrase": True
},
{
"section_marker": True
}
]
}
}]
matcher = Matcher(nlp.vocab, validate=True)
matcher.add('mymatch', [pattern], greedy='LONGEST') As I have already used
What is the "right" way to write the pattern? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
The
|
Beta Was this translation helpful? Give feedback.
The
_
values can only be specified individually, so you'd want something like: