Extract wanted text from pattern #5412
-
{"label": "IMMAT", "pattern": [{"IS_ALPHA": true,"LENGTH": 1},{ "ORTH": "comme"},{"IS_ALPHA":true},{"IS_ALPHA": true,"LENGTH": 1},{ "ORTH": "comme"},{"IS_ALPHA":true},{"IS_DIGIT":true , "LENGTH": 3},{"IS_ALPHA": true,"LENGTH": 1},{ "ORTH": "comme"},{"IS_ALPHA":true},{"IS_ALPHA": true,"LENGTH": 1}]} This pattern allow me to extract text like this : 'a comme alain b comme bernanrd 123 c comme charles d_IMMAT'] Your Environment
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
If you're not using any operators/quantifiers, the token position in the match should correspond to the token position in the pattern, so the first If the pattern does include operators, unfortunately the |
Beta Was this translation helpful? Give feedback.
If you're not using any operators/quantifiers, the token position in the match should correspond to the token position in the pattern, so the first
{ "ORTH": "comme"}
in the pattern should correspond to the second token in the matched span.If the pattern does include operators, unfortunately the
Matcher
doesn't support capturing groups at this point (see #3275), so there's no easy way to align the pattern with the matched tokens.