Differences between revisions 3 and 4
Revision 3 as of 2009-11-28 15:04:55
Size: 684
Editor: Elias
Comment: 删除对PageComment2组件的引用
Revision 4 as of 2009-12-25 07:10:03
Size: 686
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 6: Line 6:
::-- ZoomQuiet [[[DateTime(2007-05-08T02:39:44Z)]]]
[[TableOfContents]]
::-- ZoomQuiet [<<DateTime(2007-05-08T02:39:44Z)>>]
<<TableOfContents>>
Line 9: Line 9:
[[Include(CPUGnav)]] <<Include(CPUGnav)>>
Line 13: Line 13:
[http://groups.google.com/group/python-cn/t/76703597d06173de CPyUG:26258- 中英文混合,词数如何统计?] [[http://groups.google.com/group/python-cn/t/76703597d06173de|CPyUG:26258- 中英文混合,词数如何统计?]]

中英文混合,词数如何统计? ::-- ZoomQuiet [2007-05-08 02:39:44]

CPUG联盟::

CPUG::门户plone

BPUG

SPUG

ZPUG

SpreadPython Python宣传

1. batfree.混合字串统计

CPyUG:26258- 中英文混合,词数如何统计?

   1 import re
   2 cjkReg = re.compile(u'[\u1100-\uFFFDh]+?')
   3 trimedCJK = cjkReg.sub( ' a ', inputString, 0)# replace the CJK with the word a
   4 return  len(trimedCJK.split())
  • 做过一部分测试,与Word里面的字数统计数目一样,不过不知道是不是还有问题。

1.1. 反馈

MicroProj/2007-05-08 (last edited 2009-12-25 07:10:03 by localhost)