Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do autocorrect algorithms work in PHP and/or C#?

Tags:

.net

sql

php

I am trying to figure out how autocorrect algorithms can be implemented in either PHP or C#.

In short, I have a user inputted word that should be able to have minor misspelling be tolerated. I also have an SQL database of correctly spelled words. I want to be able to grab the closest (correctly) spelled word from the database to that which the user entered.

I realize there are a zillion autocorrect packages out there, but I would like to be able to customize it, so I am looking for any information on implementing this functionality in either PHP or C#.

Many thanks, Brett

like image 424
Brett Avatar asked Feb 26 '23 05:02

Brett


1 Answers

I am assuming you mean Peter Norvig's spell corrector, only written in C# or PHP (1, 2) as linked from his site.

This is essentially the method Google uses for spelling corrections.

like image 80
Oded Avatar answered Mar 06 '23 14:03

Oded