擅长:python、mysql、java
<p>应该将字符串直接传递给Counter的构造函数</p>
<pre><code>cc = c.Counter( "this is a test" )
cc[" "] # will be 3
</code></pre>
<p>要做单词,只需在空格上分开(或者在句点上分开)</p>
<pre><code>cc = c.Counter( "this is a test test".split( " " ) )
cc[ "test" ] # will be 2
</code></pre>