Skip to content

ropensci/hunspell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Mar 22, 2025
923e3ce · Mar 22, 2025
Mar 22, 2025
Aug 16, 2024
Mar 14, 2017
Dec 14, 2018
Aug 16, 2024
Mar 22, 2025
Oct 27, 2023
Aug 16, 2024
Dec 9, 2020
Dec 13, 2017
Mar 22, 2025
Jul 12, 2016
Dec 14, 2018
Aug 7, 2024
Sep 4, 2022
Mar 22, 2025

Repository files navigation

rOpenSci: The hunspell package

High-Performance Stemmer, Tokenizer, and Spell Checker for R

Project Status: Active – The project has reached a stable, usable state and is being actively developed. CRAN_Status_Badge CRAN RStudio mirror downloads

Low level spell checker and morphological analyzer based on the famous hunspell library https://hunspell.github.io. The package can analyze or check individual words as well as tokenize text, latex, html or xml documents. For a more user-friendly interface use the 'spelling' package which builds on this package with utilities to automate checking of files, documentation and vignettes in all common formats.

Installation

This package includes a bundled version of libhunspell and no longer depends on external system libraries:

install.packages("hunspell")

Documentation

About the R package:

Hello World

# Check individual words
words <- c("beer", "wiskey", "wine")
correct <- hunspell_check(words)
print(correct)

# Find suggestions for incorrect words
hunspell_suggest(words[!correct])

# Extract incorrect from a piece of text
bad <- hunspell("spell checkers are not neccessairy for langauge ninja's")
print(bad[[1]])
hunspell_suggest(bad[[1]])

# Stemming
words <- c("love", "loving", "lovingly", "loved", "lover", "lovely", "love")
hunspell_stem(words)
hunspell_analyze(words)

The spelling package uses this package to spell R package documentation:

# Spell check a package
library(spelling)
spell_check_package("~/mypackage")