如何比较字符串中的两个字符串和计数不匹配 [英] How to compare two string and count mismatch in string

查看:115
本文介绍了如何比较字符串中的两个字符串和计数不匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个Web应用程序,我需要在字符串中获取多个不匹配的单词。实际应用程序是一个打字sofwtare。请帮助我。

解决方案

引用:

我正在开发一个Web应用程序,其中我需要在字符串中获得多个不匹配的单词。实际应用是打字 sofwtare 。请帮帮我。



哦,具有讽刺意味的是:-)



为了在这样的应用程序中检查有效的字符串你应该写一个解析器,这不是一个简单的任务。作为替代方案,您可以在用户输入上运行编译器并报告其(可能已过滤)错误消息。


您可以使用Word的拼写检查程序 [ ^ ]或第三方如拼写检查 [ ^ ]。

如果您正在构建自己的拼写检查程序,那么您需要一个语言解析器。

i am developing a web application where i need to get number of mismatch words in the string. actually application is a typing sofwtare. please help me.

解决方案

Quote:

i am developing a web application where i need to get number of mismatch words in the string. actually application is a typing sofwtare. please help me.


Oh, the irony :-)

In order to check for valid strings in such a application you should write a parser and that's not a simple task. As an alternative you could run a compiler on the user input and report its (possibly filtered) error messages.


You can use Word's spell checker[^] or third parties like SpellCheck[^] in your application.
If you are building your own spell checker, then you need a language parser.


这篇关于如何比较字符串中的两个字符串和计数不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆