Skip to content

Fix match output for optional nodes in queries with multiple alternatives - #348

Open
matthias-stemmler wants to merge 1 commit into
korpling:mainfrom
matthias-stemmler:bugfix/optional-node-output-multiple-alternatives
Open

matthias-stemmler wants to merge 1 commit into
korpling:mainfrom
matthias-stemmler:bugfix/optional-node-output-multiple-alternatives

Conversation

@matthias-stemmler

Copy link
Copy Markdown
Contributor

Hey there,

I found another bug (introduced in #299) caused by the confusion between global and alternative-local node indices, similar to #338: In alternatives other than the first, the check whether to include a node in the output uses the wrong index, so when there's an optional node before a non-optional node in such an alternative, the wrong nodes get included. E.g. for tok | tok? !. lemma, an unrelated node gets included instead of the lemma node.

This PR doesn't include the refactoring mentioned in #338 (comment). Instead, I'm just passing the alternative index (which is available where we need it since #342) along with the alternative-local node index. I also considered using variable names instead of node indices to avoid the confusion altogether, but this would have been too big of a change for this bugfix - it's probably better addressed in a dedicated refactoring.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant