在C#中字数算法算法、字数

由网友(撩汙酷野浪)分享简介:我在寻找一个好词计数类或函数。当我复制和粘贴的东西从互联网上,并将它与我的自定义字计数算法和MS Word比较它始终是关闭的一点点超过10%。我认为这是太多了。所以,不要你们知道在C#中的精确字数统计算法。I am looking for a good word count class or function. Wh...

我在寻找一个好词计数类或函数。当我复制和粘贴的东西从互联网上,并将它与我的自定义字计数算法和MS Word比较它始终是关闭的一点点超过10%。我认为这是太多了。所以,不要你们知道在C#中的精确字数统计算法。

I am looking for a good word count class or function. When I copy and paste something from the internet and compare it with my custom word count algorithm and MS Word it is always off by a little more then 10%. I think that is too much . So do you guys know of an accurate word count algorithm in c#.

推荐答案

String.Split由predefined字符。使用标点符号,空格(删除多个空间),以及其他任何字符,你确定是字拆分

String.Split by predefined chars. Use punctuations, spaces (remove multiple space), and any other chars that you determine to be "word splits"

你尝试过什么?

我没看到,previous用户得到钉的链接,但这里是使用正则表达式,或者字符匹配的一些例子。希望它能帮助,没有人受到伤害X - )

I did see that the previous user got nailed for links, but here is some examples of using regex, or char matching. Hope it helps, and nobody gets hurt X-)

String.Split法(的char [])

在C#中字计数器

C#字数

阅读全文

相关推荐

最新文章