From 7f958bbc11ff397b152fbd61639a7ac021292648 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 20 May 2020 13:56:42 +0200 Subject: [PATCH] actor_fetcher: small fixes --- R/actor_fetcher.R | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/R/actor_fetcher.R b/R/actor_fetcher.R index 829e2c1..226d745 100644 --- a/R/actor_fetcher.R +++ b/R/actor_fetcher.R @@ -76,14 +76,15 @@ actor_fetcher <- function(out, sent_dict = NULL, actor_ids = NULL, cores = 1, lo ud_sent <- out_row$`_source.ud`[[1]] %>% select(-one_of('exists')) %>% unnest() %>% - filter(upos != 'PUNCT') %>% # For getting proper word counts + filter(upos != 'PUNCT') # For getting proper word counts if ("lem_u" %in% colnames(sent_dict)) { ud_sent <- ud_sent %>% mutate(lem_u = str_c(lemma,'_',upos)) %>% left_join(sent_dict, by = 'lem_u') } else if ("lemma" %in% colnames(sent_dict)) { ud_sent <- ud_sent %>% - left_join(sent_dict, by = 'lemma') + left_join(sent_dict, by = 'lemma') %>% + mutate(lem_u = lemma) } ud_sent <- ud_sent %>% group_by(sentence_id) %>% @@ -119,7 +120,7 @@ actor_fetcher <- function(out, sent_dict = NULL, actor_ids = NULL, cores = 1, lo ) if (!is.null(actor_ids)) { - out_row <- filter(out_row, ids %in% actorids ) + out_row <- filter(out_row, ids %in% actor_ids ) } ### Get list of party ids occuring more than once in the document