query_gen_actors: changed script order for belgium exceptions

master
Erik de Vries 6 years ago
parent 3bfe61e425
commit 8d19333e59

@ -69,6 +69,7 @@ query_gen_actors <- function(actor, country, pre_tags, post_tags) {
### If country is belgium, check if there is an apostrophe in middlenames, if so, search for last name both with capitalized and lowercased last name ### If country is belgium, check if there is an apostrophe in middlenames, if so, search for last name both with capitalized and lowercased last name
if (country == 'be') { if (country == 'be') {
if (T %in% str_detect(actor$`_source.middleNames`,"'")) { if (T %in% str_detect(actor$`_source.middleNames`,"'")) {
lastname <- paste0('(',actor$`_source.lastName`,' OR ',actor$`_source.lastName`,genitive,' OR ',tolower(actor$`_source.lastName`),' OR ',tolower(actor$`_source.lastName`),genitive,')')
query_string <- paste0('(((\\"', query_string <- paste0('(((\\"',
actor$`_source.firstName`, actor$`_source.firstName`,
' ', ' ',
@ -86,8 +87,8 @@ query_gen_actors <- function(actor, country, pre_tags, post_tags) {
' ', ' ',
actor$`_source.lastName`,genitive, actor$`_source.lastName`,genitive,
'\\"~5) AND ',lastname) '\\"~5) AND ',lastname)
lastname <- paste0('(',actor$`_source.lastName`,' OR ',actor$`_source.lastName`,genitive,' OR ',tolower(actor$`_source.lastName`),' OR ',tolower(actor$`_source.lastName`),genitive,')')
} else { } else {
lastname <- paste0('(',actor$`_source.lastName`,' OR ',actor$`_source.lastName`,genitive,')')
query_string <- paste0('(((\\"', query_string <- paste0('(((\\"',
actor$`_source.firstName`, actor$`_source.firstName`,
' ', ' ',
@ -97,9 +98,9 @@ query_gen_actors <- function(actor, country, pre_tags, post_tags) {
' ', ' ',
actor$`_source.lastName`,genitive, actor$`_source.lastName`,genitive,
'\\"~5) AND ',lastname) '\\"~5) AND ',lastname)
lastname <- paste0('(',actor$`_source.lastName`,' OR ',actor$`_source.lastName`,genitive,')')
} }
} else { } else {
lastname <- paste0('(',actor$`_source.lastName`,' OR ',actor$`_source.lastName`,genitive,')')
query_string <- paste0('(((\\"', query_string <- paste0('(((\\"',
actor$`_source.firstName`, actor$`_source.firstName`,
' ', ' ',
@ -109,7 +110,6 @@ query_gen_actors <- function(actor, country, pre_tags, post_tags) {
' ', ' ',
actor$`_source.lastName`,genitive, actor$`_source.lastName`,genitive,
'\\"~5) AND ',lastname) '\\"~5) AND ',lastname)
lastname <- paste0('(',actor$`_source.lastName`,' OR ',actor$`_source.lastName`,genitive,')')
} }

Loading…
Cancel
Save