-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to change the matching criterion of Capture constraints (global conditions) from exact string matching to any subexpression matching. #494
Comments
You probably want to have a look at the CWB (where the query language originates from) does handle regex constraints like I think adding a function may be the best approach. What would be needed:
(1 and 2 would suffice for your use case I think; if we also have 3, that would be something we could merge into BlackLab, so extension functions can be kept in a separate .jar and activated as needed by users of BlackLab) I hope this helps you get started. Don't hesitate to ask follow-up questions, and please create a pull request when you get this working! |
Thank you very much for your immediate reply! Your answer helped me a lot. |
Sorry, I did mean Your breakpoint in You can also set one in But like I said, I think you instead want a query like |
Thanks again for your help and immediate reply! As you said, I set a breakpoint in MatchFilterEquals.evaluate (engine\target\classes\nl\inl\blacklab\search\matchfilter\MatchFilterEquals.class) and used the query: A:[] B:[] :: A.phr_b=B.phr_e. But this breakpoint does not take effect. From my observation, this query uses MatchFilterTokenAnnotationEqualsString class. I don't understand the reason, so I'm very sorry to ask you for leave. Looking forward to your answer, thank you again for your time and patience. |
That's very strange! Ik tried it just now on the dev branch with the query Could you also place a breakpoint in Other interesting breakpoints would be |
Hi!
I would like to know how to change the matching criteria of Capture constraints (global conditions) from an exact string match to an arbitrary subexpression match.
For example, BCQL: A.phr_b = B.phr_e (the content of A.phr_b is "QP_4_5|NP_4_6"; the content of B.phr_e is "NP_4_6|VP_2_6"), which obviously cannot be judged as equal in the current BlackLab. But I hope that if the parts separated by the symbol "|" in the two global conditions have a common intersection ("NP_4_6"), they will be considered equal.
I observed the code in BlackLab that parses BCQL (such as SpanQueryConstrained.java), executes Lucene (such as Search.java), and retrieves the result post-processing code (such as QueryTool.java). But I haven't found where the function of matching global conditions is implemented.
So I would like to ask you about the specific code files and locations that need to be modified to implement the above functions.
Thank you for your time and assistance.
The text was updated successfully, but these errors were encountered: