Closed johannacronenberg closed 10 months ago
https://github.com/IPS-LMU/emuR/blob/eb703f23c8295c76952aa786d149c67a7b2df9b2/R/emuR-bas_webservicesDBI.R#L2341
I submitted a data frame for the argument "language" in the runBASwebservice_g2pForTokenization() function and the following error was returned:
Error in if (unique(language$bundle) != unique(bundles$bundle)) { : the condition has length > 1
I suspect that the problem is in the line of code indicated above and might be solved by replacing the line with:
if (! all(sort(unique(language$bundle)) == sort(unique(bundles$name))))
Here is a way of replicating the bug:
create_emuRdemoData(dir = tempdir()) path2ae <- file.path(tempdir(), "emuR_demoData", "ae_emuDB") ae <- load_emuDB(path2ae, verbose = F) langs <- list_bundles(ae) %>% rename(bundle = name) %>% mutate(language = c(rep("deu-DE", times = 3), rep("ita-IT", times = 4))) runBASwebservice_g2pForTokenization(handle = ae, transcriptionAttributeDefinitionName = "Utterance", language = langs, orthoAttributeDefinitionName = "word")
https://github.com/IPS-LMU/emuR/blob/eb703f23c8295c76952aa786d149c67a7b2df9b2/R/emuR-bas_webservicesDBI.R#L2341
I submitted a data frame for the argument "language" in the runBASwebservice_g2pForTokenization() function and the following error was returned:
Error in if (unique(language$bundle) != unique(bundles$bundle)) { : the condition has length > 1
I suspect that the problem is in the line of code indicated above and might be solved by replacing the line with:
if (! all(sort(unique(language$bundle)) == sort(unique(bundles$name))))
Here is a way of replicating the bug:
create_emuRdemoData(dir = tempdir()) path2ae <- file.path(tempdir(), "emuR_demoData", "ae_emuDB") ae <- load_emuDB(path2ae, verbose = F) langs <- list_bundles(ae) %>% rename(bundle = name) %>% mutate(language = c(rep("deu-DE", times = 3), rep("ita-IT", times = 4))) runBASwebservice_g2pForTokenization(handle = ae, transcriptionAttributeDefinitionName = "Utterance", language = langs, orthoAttributeDefinitionName = "word")