# NOT RUN {
# }
# NOT RUN {
library(rvest)
library(readr)
library(dplyr)
library(stringr)
library(tidyr)
u <- "https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines"
h <- read_html(u)
misspellings <- h %>%
html_nodes("pre") %>%
html_text() %>%
readr::read_delim(col_names = c("misspelling", "correct"), delim = ">",
skip = 1) %>%
mutate(misspelling = str_sub(misspelling, 1, -2)) %>%
unnest(correct = str_split(correct, ", ")) %>%
filter(Encoding(correct) != "UTF-8")
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab