L25 Spell Correction
用户输入input, 候选词 candidates
分为两个场景:1.错别字 2.不是错别字,但不适合 I am go(going) home
编辑距离(edit distance) 很经典的DP算法,很容易被考
1.insert
2.delete
3.replace
伪代码:
for word in dic:
edit_dist(word, currentword) #计算编辑距离
return best_candidate
DP算法的核心思想:
Big Problem = > Smaller Problem
edit_dist:计算
DP学习:十个问题仔细看。