(V3) What is the meaning of an OP in a DependencyMatcher pattern? #6783
-
I was experimenting putting them at the end of a pattern and it worked in RC2 (not RC3). Like so: [
{
'RIGHT_ID': 'body_part',
'RIGHT_ATTRS': {'ENT_TYPE': 'body_part'},
},
{
'LEFT_ID': 'body_part',
'REL_OP': '.',
'RIGHT_ID': 'trait1',
'RIGHT_ATTRS': {'ENT_TYPE': {'IN': TRAITS}},
},
{
'LEFT_ID': 'trait1',
'REL_OP': '>',
'RIGHT_ID': 'trait2',
'RIGHT_ATTRS': {'ENT_TYPE': {'IN': TRAITS}, 'OP': '?'},
},
], The question "?" OP seems pretty intuitive at the end of a pattern but "*" and "+" OPs are less intuitive. I would interpret them as continuing the chain of (REL_OP RIGHT_ATTR) down/up/whatever the tree. And in the middle of a pattern? I'm at a loss. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Basically, You want each token pattern to return matches that are all exactly one token long. If there is some kind of There was just a major refactoring of the code in progress to improve the speed (by a lot!) and now that that's settled, I'll work on the validation and warnings/errors related to this. There is also a bug related to |
Beta Was this translation helpful? Give feedback.
Basically,
OP
other than"OP": "!"
does not make sense inDependencyMatcher
RIGHT_ATTR
token patterns right now.You want each token pattern to return matches that are all exactly one token long. If there is some kind of
OP
in the dependency matcher patterns themselves related to the tree structure, it would need to be associated with theREL_OP
operators, not the token pattern operators. There are not currently any operators like this and I think that the current search algorithm would make it difficult to support any except for having optional "leaf" nodes in the pattern, but I'd have to look at the details again to be sure.There was just a major refactoring of the code in progress to …