IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> Python知识库 -> Python英文分词_词频统计_按词频排序 -> 正文阅读

[Python知识库]Python英文分词_词频统计_按词频排序

文本cet6read.txt

QuestionS 61 to 65 are based on the following passage.
Many bankers may be worried about whether some fancy product dreamed up might yetlead to a visit from the police. Daniel Dantas, a financier, who has profited by operating at themiddle place where business and government meet in Brazil, has been opening the door to findthe police outside for much of the
  past decade. On December 2nd he was convicted of a less sophisticated crime: trying tobribe police officers. Mr. Dantas, who has acquired great notoriety in Brazil, was fined $ 5million and sentenced to ten years in prison. He has appealed against his conviction.
  The charge stems from a police investigation into money-laundering known asOperation Satiagraha. It grew out of a previous investigation into Mr. Dantas’ use of Kroll, asecurity consultancy, to watch over his business partners. During this investigation the policeseized a computer from Opportunity, Mr. Dantas’s investment bank, which contained datafrom the mid-1990s to 2004 and apparently showed suspicious movements of money.
  The judge found that Mr. Dantas tried to pay bribes, via two go-betweens, to keep hisname out of the Satiagraha investigation. A man fitted with a bugging device was offered $1million in cash, with another $ 4 million to follow, the police say. They claim that Mr. Dantas’strick involved money travelling to the Cayman Islands, then via the British Virgin Islands to anaccount in Ireland, on to Delaware, and then re-entering Brazil as foreign investment.
  For Mr. Dantas his crime is a steep fall from grace. A man who sleeps little and socializesless, he is a vegetarian and self-made billionaire, a gifted financier who has serially fallen outwith his business partners. He once controlled a large telecoms firm, acting for investors whoincluded Citigroup. He says he is the victim of a conspiracy mounted by the government.
  It is Mr. Dantas’ supposed influence in government circles that has added to his notoriety.During the1990s, when many state-owned businesses were privatized, Mr. Dantas positionedhimself as the man with the needed expertise and contacts. He enjoyed easy access to thegovernment of President Femando Henrique Cardoso, including meetings with the presidenthimself. That influence carried through into the government of President Luiz Inacio Lula daSilva. Mr. Dantas is alleged to have been one of the funders of a cash-for-votes scheme inBrazil’s  Congress mounted by leaders of Lula’s Workers’ Party in 2003-2004. Many of thosewho have had dealings with Mr. Dantas insist that these have been legitimate and conducted ingood faith. They include Luiz Eduardo Greenhalgh, a lawyer and PT politician, whom he hired asa consultant.
  61. What kind of crime was Daniel Dantas convicted of according to the passage?
  A.A crime quite experienced and tactful.
  B.A crime by operating at the middle place.
  C.A crime attempting to temper police to work for him.
  D.A crime in money-laundering.
  62. How did the police convict the charge against Mr. Dantas according to the passage?
  A.They seized a computer by chance and got some evidence.
  B.They directly conducted a probe into him.
  C.They found he tempered police officers to delete his name.
  D.They questioned him and made sure the process of money-laundering.
  63. Mr. Dantas’ relationship with his business partners is that __
  A.he usually gets along well with them
  B.he does not have a good relationship with them
  C.he totally trusts all of his business partners
  D.he believes that they make him a victim
  64. What can we learn about Mr. Dantas according to the passage?
  A.He is a gifted financier and less socialized person.
  B.He always enjoys notorious fame in economic and political field.
  C.He is a vegetarian who likes making food by himself.
  D.His tragedy was mounted by the government conspiracy.
  65. What kind of relationship is reflected between Mr. Dantas and government in thepassage?
  A.His influence on government may reduce his notoriety and crime.
  B.In business privatization, he participated with demanding expertise.
  C.He never meets the President himself.
  D.People knowing him deem that he was sheer evil.

import re

# 读取txt文件
with open("cet6read.txt","r",encoding='UTF-8') as f:
    corpus = f.read().strip("\n")
f.close()

# 标点替换为空格、大写字母转换为小写字母、将corpus中每个词拆分成list内元素
corpus = re.sub('[^A-Za-z0-9 ]+', '', corpus).replace("_", '')
corpus = corpus.strip('').lower()
corpus = corpus.split()

# 创建字典、key为单词,value为出现次数
word_fre_dict = dict()
for item in corpus:
    if item not in word_fre_dict:
        word_fre_dict[item]=0
    word_fre_dict[item]+=1
print(word_fre_dict)

# 按照value进行降序排序
word_fre_dict = sorted(word_fre_dict.items(), key=lambda x: x[1], reverse=True)
print(word_fre_dict)

  Python知识库 最新文章
Python中String模块
【Python】 14-CVS文件操作
python的panda库读写文件
使用Nordic的nrf52840实现蓝牙DFU过程
【Python学习记录】numpy数组用法整理
Python学习笔记
python字符串和列表
python如何从txt文件中解析出有效的数据
Python编程从入门到实践自学/3.1-3.2
python变量
上一篇文章      下一篇文章      查看所有文章
加:2022-04-22 18:32:27  更:2022-04-22 18:33:03 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年11日历 -2024/11/15 18:01:25-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码