Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是在采访中被问到的。
我认为可以通过构建所有有效单词的 trie 来完成答案,然后可以根据可能的有效路径提出建议,否则会被认为是不正确的。
假设如果用户键入 apfle,系统会检测到在 ap 之后可能的有效路径是 app,这将满足 apple 的要求。
还有比这更好的解决方案吗?也许是拼写检查器实现的。
看:
谷歌“你的意思是什么?” 算法工作?
我如何近似“您的意思是?” 不使用谷歌?
如何编写拼写校正器
Youtube 视频:搜索 101
在典型的搜索引擎中,你会发现很多分析器的东西,它们都指向同一个潜在的问题。一个非常流行的分析器是 n-gram 分析器。
也许这会有所帮助。