Do multiple patterns need an if/else situation in dependency matcher? Plus: wildcard issue #10636
-
Hi, This is what I intend:
In order to match the first case, I have:
Note that I wanted to use "DEP": {}, the wildcard available in the Matcher, but then an error message occurred, so I used not in ROOT as (almost) always never a ROOT will be dependent of a subject, Apart from it, the code above matches "Good children...", "Paul's son..." but not "Children...", "Paul..." because I can't make the last dictionary (part_of_subject) optional. So, to match "Children...", "Paul..." it would either be: (a) this code:
that would appear as:
OR (b) run (ii), that would match all four examples. Run (i), that would match "Good children" and "Paul's son", and get these outputs and remove from the list of the results of the second code ran above. (i) = ["Good children", "Paul's son", "Children", "Paul"] If either of these ways is the way, ok, but could there be a simpler way? This situation in just an example, there may be more. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I think your current method is OK, but the way I would handle this is to just use your second rule and then directly check the matched nodes in code to see if they have dependents or not using |
Beta Was this translation helpful? Give feedback.
I think your current method is OK, but the way I would handle this is to just use your second rule and then directly check the matched nodes in code to see if they have dependents or not using
Token.children
.