-
Notifications
You must be signed in to change notification settings - Fork 9
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
KWIC crashes when all results are filtered out by positivelist #91
Comments
In addition, in other corpora, it doesn't crash but throws an error:
|
I think I have a possible explanation: In the context-method, there is the following line: It is possible that all elements within ctxt are getting dropped here. The problem is that this isn't being checked again in the code that follows the positivelist trim:
And even if ctxt isn't NULL here, it could be after the stoplist is used for filtering. To solve this, it might be possible to just but
and check again afterwards if ctxt is NULL now.
|
Thanks a lot, particularly for developing a potential solution! The check whether For checking whether everything works, I used the following code, which adopts the new workflow to create subcorpora / partitions. library(polmineR)
use("GermaParl")
corpus("GERMAPARL") %>%
subset(lp == "17" & role %in% c("gov", "mp")) %>%
kwic(query = '"[Aa]ttack.*"', positivelist = "Messer", cqp = TRUE)
corpus("GERMAPARL") %>%
kwic(query = '"[Aa]ttack.*"', cqp = TRUE, positivelist = "Messer") The bugfix is included in polmineR v0.7.11.9026 I just pushed to the dev branch. |
I have introduced a test that will check that the return value is NULL if all matches have been dropped due to a positivelist. As this may safeguard the confidence that everything works as intended, I will close the issue. |
Leads to a legit crash of RStudio.
polmineR_0.7.11.9024
The text was updated successfully, but these errors were encountered: