-
Notifications
You must be signed in to change notification settings - Fork 13
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
crash if there is no non-special characters present #23
Comments
Thanks for the note. Can you please provide a reproducible example? I don't need the debugging output, just the error message that I can reproduce. Thanks! |
library(quanteda)
library(quanteda.dictionaries)
okString <- "Hello"
output <- liwcalike(okString, dictionary = data_dictionary_NRC)
head(output) Works perfectly library(quanteda)
library(quanteda.dictionaries)
errorString <- "..."
output <- liwcalike(errorString, dictionary = data_dictionary_NRC) will crash |
library(quanteda)
library(quanteda.dictionaries)
okString <- "ThisWordExceeds65CharsThisWordExceeds65CharsThisWordExceeds65Chars"
output <- liwcalike(okString, dictionary = data_dictionary_NRC)
head(output) Works perfectly library(quanteda)
library(quanteda.dictionaries)
okString <- "ThisWordExceeds80CharsThisWordExceeds80CharsThisWordExceeds80CharsThisWordExceeds80Chars"
output <- liwcalike(okString, dictionary = data_dictionary_NRC)
head(output) will crash (the "word" is 80 characters or longer) the cause is this trim char_trim(x, "sentences", min_ntoken = min_sentence_length, max_ntoken = max_sentence_length) in textstat_readability.corpus(corpus(x), measure, remove_hyphens, min_sentence_length, max_sentence_length, ...) |
Thanks, will investigate. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It looks like I found some problem:
The above works perfectly.
Now try a input without any non-special characters:
So there is some trim of characters but no check if this gives an empty result. So a simple ":-)" in the input (not this uncommon) might become a problem.
What do you think?
The text was updated successfully, but these errors were encountered: