You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had this in a todo.R file just hanging out, and figured I should log it so I don't lose the thought:
# Something like this should go into remove_diacritics. Look for more examples
# in wiktionary.
dplyr::mutate(
text,
word = stringr::str_replace_all(.data$word, "æ", "ae"),
word = stringr::str_replace_all(.data$word, "œ", "oe"),
word = stringr::str_replace_all(.data$word, "ð", "th"),
word = stringr::str_replace_all(.data$word, "þ", "th"),
word = stringr::str_replace_all(.data$word, "ø", "o"),
word = stringr::str_replace_all(.data$word, intToUtf8(305), "i"),
word = stringr::str_replace_all(.data$word, intToUtf8(273), "d"),
word = stringr::str_replace_all(.data$word, intToUtf8(322), "gh"),
word = stringr::str_replace_all(.data$word, intToUtf8(945), "a"),
word = stringr::str_replace_all(.data$word, intToUtf8(178), "2"),
word = stringr::str_replace_all(.data$word, intToUtf8(8322), "2"),
word = stringr::str_replace_all(.data$word, intToUtf8(8323), "3"),
word = stringr::str_replace_all(.data$word, intToUtf8(8324), "4"),
word = stringr::str_replace_all(.data$word, intToUtf8(8326), "6"),
word = stringr::str_replace_all(.data$word, intToUtf8(8310), "6"),
word = stringr::str_replace_all(.data$word, intToUtf8(8211), "-")
)
I'd love to find a more standardized way to deal with this.
The text was updated successfully, but these errors were encountered:
I had this in a
todo.R
file just hanging out, and figured I should log it so I don't lose the thought:I'd love to find a more standardized way to deal with this.
The text was updated successfully, but these errors were encountered: