DependencyMatcher Optional Tokens #11614
-
Hi, I have a usecase where I want to match German "Futur I" but not "Futur II". I use the following pattern:
This matches Futur I if the infinitive still has some child token that is not a participle. But it doesn't match if there are no child tokens. Can I somehow make the 3rd token optional? "OP": "?" does not work. This is related to the discussions:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
As mentioned in the threads you link to / posted in, the DependencyMatcher can only use patterns such that each node matches exactly one token. If you want to make the third token optional, what you can do is simply add two patterns with the same label. The first pattern would have just two tokens, and the second pattern would have all three tokens. |
Beta Was this translation helpful? Give feedback.
As mentioned in the threads you link to / posted in, the DependencyMatcher can only use patterns such that each node matches exactly one token.
OP: ?
could match 0 tokens and so it does not work.If you want to make the third token optional, what you can do is simply add two patterns with the same label. The first pattern would have just two tokens, and the second pattern would have all three tokens.