任何人都知道一个好的组件会纠正不良的语法和拼写错误吗? [英] Anyone know a good component that will correct poor grammar and spelling?

查看:73
本文介绍了任何人都知道一个好的组件会纠正不良的语法和拼写错误吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很惊讶没有大量的这些,但我正在寻找的是一段代码或一个组件,它将采用格式错误的句子,例如


我如何给你一只猫



并转换为



我如何给你一只猫



简单搜索和替换i - > I和你 - >你之类的东西会做到这一点,显然,但有一些微妙之处,如var i = 0。

I'm surprised there aren't a ton of these, but what I'm looking for is a piece of code or a component that will take poorly formed sentences such as

"how do i give u a cat"

and converts it to

"How do I give you a cat"

Simple search and replace of things like "i -> I" and "u -> you" will do this, obviously, but there are subtleties such as "var i = 0".

推荐答案

我很抱歉没有给出解决方案(这会让我大吃一惊),但是只是一种答案:在我最近的回答中(如何实现语音搜索算法。 。 [ ^ ])我试图解释为什么我不会屏住呼吸。 :-)



只举一个例子:如果你把天气拼错为是否,甚至是 wether ,在第一种情况下这个词会被错误地认为是拼写正确的,在第二种情况下,没有理由在天气之间作为是否。没有语义分析,这一切都是不可能的;而这样的分析远不止语法,是一个很大的未解决的问题。顺便说一下,在英语中这种情况非常频繁。在其他一些语言中,语法要复杂得多,不规则,从未正式描述过。



-SA
I'm sorry about not giving a solution (which would greatly surprise me), but just a kind of answer: in my recent answer (How To Implemet Phonetic Search Algorithm..[^]) I tried to explain why I would not hold my breath. :-)

Just one example: if you misspell "weather" as "whether", or even "wether", in first case the word would be mistakenly considered as correctly spelled, and in second case there would no a reason to make preference between "weather" as "whether". Without semantic analysis, it's all impossible; and such analysis is much more then grammar, is a big unsolved problem. By the way, in English such cases are extremely frequent. In some other languages, grammar is much more complex and irregular, never formally described to depth.

—SA


这篇关于任何人都知道一个好的组件会纠正不良的语法和拼写错误吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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