文件方式实现完整的英文词频统计实例

fo=open('test.txt','w')
>>> fo.write('''Hong Kong action star Jackie Chan's latest film premiered in Beijing on Sunday at an event.

The film, The Foreigner, follows Quan's (played by Chan) journey to seek revenge after his daughter is killed in a terrorist attack in London. Quan, a former member of special forces, also exposes the dirty side of British politics in the film.

Chan, who is best known for his action comedy films, is seen in the very serious role of Quan in The Foreigner.

"I want to present a different Jackie Chan, but I want my action film to continue its popularity," Chan said. "It's not the time to talk about retirement yet."

The film has been directed by New Zealand action veteran Martin Campell, who earlier directed James Bond films such as Golden Eye and Casino Royale.

Campell attended the film's Beijing premiere alongside Chinese actress Liu Tao and Irish actor Michael McElhatto — both members of cast.

Pierce Brosnan, who plays a British politician in the film and Quan's opponent, was not present at the event.

The film will be released for general screening on the Chinese mainland on Sept 30.''')
1095
>>> fo.close()
>>> fr=open('test.txt','r')
>>> fr.read()
'Hong Kong action star Jackie Chan\'s latest film premiered in Beijing on Sunday at an event.\n\nThe film, The Foreigner, follows Quan\'s (played by Chan) journey to seek revenge after his daughter is killed in a terrorist attack in London. Quan, a former member of special forces, also exposes the dirty side of British politics in the film.\n\nChan, who is best known for his action comedy films, is seen in the very serious role of Quan in The Foreigner.\n\n"I want to present a different Jackie Chan, but I want my action film to continue its popularity," Chan said. "It\'s not the time to talk about retirement yet."\n\nThe film has been directed by New Zealand action veteran Martin Campell, who earlier directed James Bond films such as Golden Eye and Casino Royale.\n\nCampell attended the film\'s Beijing premiere alongside Chinese actress Liu Tao and Irish actor Michael McElhatto — both members of cast.\n\nPierce Brosnan, who plays a British politician in the film and Quan\'s opponent, was not present at the event.\n\nThe film will be released for general screening on the Chinese mainland on Sept 30.'

 

转载于:https://www.cnblogs.com/D0204/p/7595600.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值