| name | hunspell |
| description | R hunspell package for spell checking. Use for spell checking and morphological analysis. |
hunspell
High-performance stemmer, tokenizer, and spell checker.
Spell Checking
library(hunspell)
hunspell("This is a tset of speling")
hunspell(c("hello", "wrold", "test"))
Suggestions
hunspell_suggest("speling")
hunspell_suggest(c("speling", "wrold"))
Check Single Word
hunspell_check("hello")
hunspell_check("wrold")
hunspell_check(c("hello", "wrold", "test"))
Stemming
hunspell_stem("running")
hunspell_stem("cats")
hunspell_stem(c("running", "cats", "better"))
Analyze
hunspell_analyze("running")
hunspell_analyze("cats")
Dictionaries
list_dictionaries()
hunspell("bonjour", dict = "fr_FR")
Custom Dictionary
dict <- dictionary("en_US", add_words = c("RStudio", "tidyverse"))
hunspell("RStudio", dict = dict)
Tokenization
hunspell_parse("This is a test sentence.")
hunspell_parse("This is a test.", format = "text")
hunspell_parse("<p>HTML text</p>", format = "html")
hunspell_parse("\\LaTeX{} text", format = "latex")
With Text Data
text <- "This is a tset of the speling checker."
misspelled <- hunspell(text)[[1]]
suggestions <- hunspell_suggest(misspelled)