actorizer: fixed handling of empty results due to regex filtering

master
Erik de Vries 6 years ago
parent 8e920f5f37
commit a29d04dacd

@ -83,7 +83,7 @@ actorizer <- function(out, localhost = F, ids, prefix, postfix, pre_tags, post_t
} else {
sentence_ids <- actor_sentences
}
if (length(sentence_ids > 0)) {
# Generating nested sentence start and end positions for actor sentences
ud <- ud %>%
filter(sentence_id %in% sentence_ids)
@ -102,7 +102,7 @@ actorizer <- function(out, localhost = F, ids, prefix, postfix, pre_tags, post_t
sentence_start = list(sentence_start),
sentence_end = list(sentence_end)
)
if (length(ud$doc_id > 0)) {
return(
data.frame(ud, # Sentence id, start and end position for actor sentences
actor_start = I(list(actor_start)), # List of actor ud token start positions

Loading…
Cancel
Save