Harshad Patil
Harshad Patil

Reputation: 313

Case Insensitive spell checker in R

I am currently using hunspell_check() function in hunspell package in R to classify words as correct or incorrect. But the dictionary it uses is case sensitive.

Is there a way to specify case insensitivity if I have to continue using the same package? Or is there any other package in R which I can use?

Upvotes: 0

Views: 448

Answers (1)

David Klotz
David Klotz

Reputation: 2431

Based on this issue, it looks like using toupper is a workaround. E.g.:

g <- c("albany", "Albany", "ALBANY")

hunspell_check(g)
[1] FALSE  TRUE FALSE

hunspell_check(toupper(g))
[1] TRUE TRUE TRUE

Upvotes: 3

Related Questions