1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-08 14:01:55 +02:00

(v1.2.0.9018) ab_from_text() improvement

This commit is contained in:
2020-06-26 13:15:46 +02:00
parent 4f6f056077
commit 240d817b4e
11 changed files with 15 additions and 15 deletions

4
R/ab.R
View File

@ -146,7 +146,7 @@ as.ab <- function(x, flag_multiple_results = TRUE, ...) {
}
if (isTRUE(flag_multiple_results) & x[i] %like% "[ ]") {
from_text <- suppressWarnings(ab_from_text(x[i], initial_search = FALSE, translate_ab = FALSE))
from_text <- suppressWarnings(ab_from_text(x[i], initial_search = FALSE, translate_ab = FALSE)[[1]])
} else {
from_text <- character(0)
}
@ -335,7 +335,7 @@ as.ab <- function(x, flag_multiple_results = TRUE, ...) {
if (isTRUE(flag_multiple_results)) {
found <- from_text[1L]
} else {
found <- suppressWarnings(ab_from_text(x[i], initial_search = FALSE, translate_ab = FALSE)[1L])
found <- suppressWarnings(ab_from_text(x[i], initial_search = FALSE, translate_ab = FALSE)[[1]][1L])
}
if (!is.na(found)) {
x_new[i] <- note_if_more_than_one_found(found, i, from_text)