Matcher allowing group repetition #9927
ezorita
started this conversation in
New Features & Project Ideas
Replies: 1 comment 1 reply
-
Thanks for the suggestion! That sounds like a handy feature, but also one that might be harder than you'd think to add - there's lots of potential for weird interactions with pattern chaining. One thing you can do that isn't very clean but isn't simple is to duplicate a pattern up to a given number of times. Since it's just a list, you can do something like this:
etc, up to some number. While I guess patterns might be unbounded in theory, in practice I would expect you to only need up to a certain number of repetitions. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I believe this is not currently possible but would be really helpful and is a common and important feature of other NLP libraries.
The ability to match repeated patterns across multiple tokens. A regex equivalent:
would match an arbitrarily long sequence of:
Is there a current solution with spacy that would match an arbitrarily long sequence of numbers like the above?
I guess the best would be to allow adding other patterns as attributes:
matches:
Thanks for your amazing work!
Beta Was this translation helpful? Give feedback.
All reactions