У меня есть текстовые данные, которые нуждаются в исправлении английских ошибок.
Я хочу вывод таблицы, в первом столбце указаны ошибки и все предложения по исправлению во втором столбце.
Например:
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