Spell Corrector, an R Wrapper on the Scala implementation. This is a wrapper for another project,
SpellCorrection, written in Scala. It is an
implementation of Peter Norvig's spell corrector (his article).
For the corrector to work, download a corpus, such as big.txt
by Norvig.
This repository is also a demo for my blog entry: rJava: Running Java from R, and Building R Packages Wrapping a .jar.
To install it, please make sure you have the devtools
package installed. If not, enter, in your
R console,
install.packages('devtools')
Then load the package, and run the installation:
library(devtools)
install_github('stephenhky/RSpellCorrection')
Load the package by entering
library(RSpellCorrection)
Create a Java instance for the spell corrector by entering:
corrector <- getcorrector(filepath='path/to/big.txt')
Then do the spell correction by:
correct('boook', corrector) # output 'book'
correct('statistiscs', corrector) # output 'statistics'
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.