-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Tregex: infinite loop for ?<...
#1375
Comments
Thanks, love it. A bug in an obscure syntax I added because I was tired of writing out the individual pieces by hand, using a variant of the feature probably no one will ever use. I'll try to figure out what's going on. Interesting to note btw is that when the pattern is turned back into a tregex, it does not use the I suspect the optional syntax in general is wrong somehow... there shouldn't be anything specific to the |
Haven't fully generalized this yet, but this also goes infinite:
This does not:
So basically any optional |
... for reference, further bugginess in it is that the pattern
gets output without the optional:
this is probably easier to fix |
well, this fixed the output of the |
Alright, figured out what's going on - basically, the under the hood, in case it wasn't clear from the previous comments, |
…s would infinite loop, as the matcher would accept a failed match even after a previous success (meaning it would always be willing to accept the same failed match again). #1375
Yes. The Thanks for all the efforts and the concise explanation! |
…s would infinite loop, as the matcher would accept a failed match even after a previous success (meaning it would always be willing to accept the same failed match again). #1375
Specifying the MULTI_RELATION as optional seems to cause an infinite loop of printing matches. I am using Tregex 4.2.0 downloaded from https://nlp.stanford.edu/software/tregex.shtml#Download and here is the command I used:
P.S.
I noticed that the testSubtreePattern of TregexTest.java includes the
<...
and!<...
but does not cover?<...
. So I gave it a try and encountered this issue.The text was updated successfully, but these errors were encountered: