【问题标题】:C++ Suggesting wrong spelled words [duplicate]C ++建议拼写错误的单词[重复] 【发布时间】:2012-11-12 19:01:47 【问题描述】: 可能重复:What algorithm gives suggestions in a spell checker? 在一个 C++ 程序中应该使用什么算法,它的目的是从一个文本文件中读取并为错误的拼写单词提供建议? 【问题讨论】: 我强烈建议您查看正则表达式。 我强烈建议不要使用正则表达式来完成这些任务。 en.wikipedia.org/wiki/Levenshtein_distance 适合这类问题。 标签: c++ c 【解决方案1】: 使用Levenshtein distance: http://thetechnofreak.com/technofreak/levenshtein-distance-implementation-c/ http://murilo.wordpress.com/2011/02/01/fast-and-easy-levenshtein-distance-using-a-trie-in-c/ 【讨论】: