actorizer: removed nested mclapply

master
Erik de Vries 6 years ago
parent 1a4ba19546
commit 5b9793cd8c

@ -40,7 +40,7 @@ actorizer <- function(out, localhost = F, ids, type, prefix, postfix, identifier
mutate(doc_id = doc$`_id`) mutate(doc_id = doc$`_id`)
markers <- doc$markers[[1]][,'start'] # Extract list of markers markers <- doc$markers[[1]][,'start'] # Extract list of markers
# Convert markers to udpipe rows (in some cases the start position doesn't align with the udpipe token start position (e.g. when anti-|||EU is treated as a single word)) # Convert markers to udpipe rows (in some cases the start position doesn't align with the udpipe token start position (e.g. when anti-|||EU is treated as a single word))
rows <- unlist(mclapply(markers, ranger, ud = ud, mc.cores = detectCores())) rows <- unlist(lapply(markers, ranger, ud = ud))
# Setting up an actor variable # Setting up an actor variable
ud$actor <- F ud$actor <- F

@ -5,7 +5,7 @@
\title{Updater function for elasticizer: Conduct actor searches} \title{Updater function for elasticizer: Conduct actor searches}
\usage{ \usage{
actorizer(out, localhost = F, ids, type, prefix, postfix, identifier, actorizer(out, localhost = F, ids, type, prefix, postfix, identifier,
udmodel, es_super, ver) es_super, ver)
} }
\arguments{ \arguments{
\item{out}{Does not need to be defined explicitly! (is already parsed in the elasticizer function)} \item{out}{Does not need to be defined explicitly! (is already parsed in the elasticizer function)}
@ -20,8 +20,6 @@ actorizer(out, localhost = F, ids, type, prefix, postfix, identifier,
\item{identifier}{String used to mark highlights. Should be a lowercase string} \item{identifier}{String used to mark highlights. Should be a lowercase string}
\item{udmodel}{The udpipe model used for parsing every hit}
\item{es_super}{Password for write access to ElasticSearch} \item{es_super}{Password for write access to ElasticSearch}
\item{ver}{Short string (preferably a single word/sequence) indicating the version of the updated document (i.e. for a udpipe update this string might be 'udV2')} \item{ver}{Short string (preferably a single word/sequence) indicating the version of the updated document (i.e. for a udpipe update this string might be 'udV2')}
@ -33,5 +31,5 @@ As this is a nested function used within elasticizer, there is no return output
Updater function for elasticizer: Conduct actor searches Updater function for elasticizer: Conduct actor searches
} }
\examples{ \examples{
actorizer(out, localhost = F, ids, type, prefix, postfix, identifier, udmodel, es_super) actorizer(out, localhost = F, ids, type, prefix, postfix, identifier, es_super)
} }

Loading…
Cancel
Save