High-Performance Stemmer, Tokenizer, and Spell Checker for R
C++ R C
Latest commit 1299f21 Jan 3, 2017 @jeroenooms jeroenooms Bump

README.md

hunspell

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

Build Status AppVeyor Build Status Coverage Status CRAN_Status_Badge CRAN RStudio mirror downloads Github Stars

A spell checker and morphological analyzer library designed for languages with rich morphology and complex word compounding or character encoding. The package can check and analyze individual words as well as search for incorrect words within a text, latex, html or xml document. Use the 'devtools' package to spell check R documentation with 'hunspell'.

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 devtools package uses this package to spell R package documentation:

# Spell check a package
library(devtools)
spell_check("~/mypackage")