У меня есть текстовые данные, которые нуждаются в исправлении английских ошибок.
Мне нужен вывод таблицы, первый столбец - ошибки, а все предложения по исправлению во втором столбце.
Например:
sentence <- "This is a word but thhis isn't and this onne as well. I need hellp"
library(hunspell)
mistakesList <- hunspell(essay)[[1]]
suggestionsList <- hunspell_suggest(mistakesList)
я пытался
do.call(rbind, Map(data.frame, A=mistakesList, B=suggestionsList))
но он возвращается
A B
thhis thhis this
onne.1 onne none
onne.2 onne one
onne.3 onne tonne
onne.4 onne Donne
onne.5 onne once
onne.6 onne Anne
onne.7 onne Yvonne
hellp.1 hellp hello
hellp.2 hellp hell
hellp.3 hellp help
hellp.4 hellp hell p
Мне нужен фрейм данных, который возвращает:
mistakes suggestions
thhis this
onne none one tonne Donne once Anne Yvonne
hellp hello hell help hell p