限制文本区域中的句子没有? [英] Limiting no of sentences in a text area?

查看:73
本文介绍了限制文本区域中的句子没有?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁能告诉我,确定有人进入文本区域的

句子数量的最佳方法是什么?


先谢谢。

Hi can anyone tell me what is the best way to determine the number of
sentences that someone enter into a text area?

Thanks in advanced.

推荐答案

ef ** ***@epitome.com.sg 写道:
你们可以告诉我什么是确定有人进入文本区域的句子数量的最佳方法是什么?

先谢谢。
Hi can anyone tell me what is the best way to determine the number of
sentences that someone enter into a text area?

Thanks in advanced.




你确定一个句子结束然后检查那个角色

顺序,你希望有人不会把一个放在一个

句子的中间,以免你得到不正确的结果,因为博士不会结束一个

的句子,但它会似乎是因为。< space>可能是一个好的

一个句子结尾的指标,但是,那你怎么建议用一个我刚刚输入的那个非常极端的句子来处理



很长但没有技术句子结束标点符号,尽管任何

试图确定句子结束会(或应该)找到它们。


!?。然后是一个空间。 RegEx的好工作除了方法中固有的

缺陷。


-

Randy

comp.lang.javascript常见问题 - http://jibbering.com/faq & ;新闻组周刊



You determine what ends a sentence and then you check for that character
sequence, and you hope that someone does not put one in the middle of a
sentence lest you get incorrect results as a Dr. would not end a
sentence but it would appear to be since a .<space> might be a good
indicator of a sentence ending, but then, how would you propose to deal
with run-on sentences such as the one I just typed that is extremely
long but has no technical sentence ending punctuation in it although any
attempt to determine a sentence end would (or should) find them.

!?. followed by a space. Good job for a RegEx except for the inherent
flaw in the approach.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly


ef*****@epitome.com.sg 说:

你可以告诉我,确定有人进入文本区域的句子数量的最佳方法是什么?

Hi can anyone tell me what is the best way to determine the number of
sentences that someone enter into a text area?




这取决于你如何定义一个句子,不是吗?


有些人可能会说要计算。 ;人物,但是可以扔给你

关闭几个...也许很多!!


当然,你不能算数人们使用标点符号

一直



That depends on how you define a sentence, doesn''t it???

Some might say to count "." characters, but that can throw you
off by a few ... maybe a lot!!

And, of course, you can''t count on people to use punctuation
consistently


Randy


感谢您的建议。我认为这不是一个完美的检查,但有些

将是必要的基线。我已经到位检查

" return"但我怎么做一个正则表达式检查1?。。让我们说b / b
说5次?


再次感谢。

Randy

Thanks for the suggestion,. Its not a perfect check I guess but some
would be necessary as a baseline. I already have in place check for
"returns" but how do i do a regular expression checking for "1?.".Lets
say 5 times?

Thanks again.


这篇关于限制文本区域中的句子没有?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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