如何自动更正算法在PHP和/或C#的工作? [英] How do autocorrect algorithms work in PHP and/or C#?
问题描述
我试图找出如何自动更正算法可以在任一 PHP
或 C#
实施。
I am trying to figure out how autocorrect algorithms can be implemented in either PHP
or C#
.
总之,我有一个用户输入的词,应该能够有轻微的拼写错误被容忍。我也有正确拼写单词的 SQL
数据库。我希望能够抓住最近的(正确)的拼写从数据库中字给该用户输入。
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.
我知道有数不胜数的自动更正包在那里,但我希望能够定制,所以我要寻找在任何 PHP $ C $实现该功能的任何信息C>或
C#
。
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#
.
非常感谢, 布雷特
推荐答案
我假设你的意思是彼得·诺维格的拼写校正只有用C#编写或PHP ( 1 , 2 )从他的网站作为链接。
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.
这篇关于如何自动更正算法在PHP和/或C#的工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!