zoukankan      html  css  js  c++  java
  • 文件方式实现完整的英文词频统计实例

    1.读入待分析的字符串

    2.分解提取单词 

    3.计数字典

    4.排除语法型词汇

    5.排序

    6.输出TOP(20)

    >>> fo=open('test.txt','w')
    >>> fo.write('''I'm a big big girl
      in a big big world
      It's not a big big thing if you leave me
      but I do do feel
      that I too too will miss you much
      miss you much...
      I can see the first leaf falling
      it's all yellow and nice
      It's so very cold outside
      like the way I'm feeling inside
      I'm a big big girl
      in a big big world
      It's not a big big thing if you leave me
      but I do do feel
      that I too too will miss you much
      miss you much...
      Outside it's now raining
      and tears are falling from my eyes
      why did it have to happen
      why did it all have to end
      I'm a big big girl
      in a big big world
      It's not a big big thing if you leave me
      but I do do feel
      that I too too will miss you much
      miss you much...
      I have your arms around me ooooh like fire
      but when I open my eyes
      you're gone...
      I'm a big big girl
      in a big big world
      It's not a big big thing if you leave me
      but I do do feel
      that I too too will miss you much
      miss you much...
      I'm a big big girl
      in a big big world
      It's not a big big thing if you leave me
      but I do feel I will miss you much
      miss you much...''')
    1107
    >>> fo.close()

     结果:

  • 相关阅读:
    expd,impd常用命令
    linux oracle 服务重启过程
    oracle 锁表查询及kill
    oracle 存储过程卡无法编辑
    oracle 各版本之间的导入导出
    与linux 病毒的一次接触
    一分钟读懂PDCA 循环
    5W2H分析法——你肯定听过的一种思维工具
    你真的懂如何进行用户调查么?
    精选互联网运营必读的 8 本书籍
  • 原文地址:https://www.cnblogs.com/xiaojiaqi/p/7595164.html
Copyright © 2011-2022 走看看