[R] spelling correction using R

Oliver Ruebenacker curoli at gmail.com
Fri Jun 15 13:01:10 CEST 2012


     Hello,

On Fri, Jun 15, 2012 at 1:10 AM, raishilpa <raishilpa.bhu at gmail.com> wrote:
> I want a code which can correct the spelling mistakes  as well as
> grammatical mistakes in the sentences...that is if I am writing following
> sentence:
>
> I want too meet my frnd bt due to hectic shcedule I cant
>
> I want output in following way:
>
> I want to met my friend but due to hectic schedule I can't.

  In general, you would build a dictionary, look up for every word in
the input whether it is in the dictionary, and if not, which is the
most similar word using some string metric.

  You will, however, face problems:

  - No dictionary is ever complete
  - Some wrong words are equally similar to multiple correct words
(e.g. should "bt" be "bit" or "but" or "bat"?)
  - Not all errors lead to wrong words (e.g. "Sum errors will will nut
bee fond because they happen to leed two sentence consisting of reel
word")

  It is therefore doubtful that spell-correction can be done non-interactively.

     Take care
     Oliver

-- 
Oliver Ruebenacker
Bioinformatics Consultant (http://www.knowomics.com/wiki/Oliver_Ruebenacker)
Knowomics, The Bioinformatics Network (http://www.knowomics.com)
SBPAX: Turning Bio Knowledge into Math Models (http://www.sbpax.org)



More information about the R-help mailing list