英语词频统计

word = '''
Uh huh yeah
Life's like this
Uh huh, uh huh
That's the way it is
'Cause life's like this
Uh huh, uh huh
That's the way it is
Chill out, what you yellin' for?
Lay back, it's all been done before
And if, you could only let it be
You will see
I like, you the way you are
When we're drivin' in your car
And you're, talkin' to me one on one
But you become
Somebody else
'Round everyone else
Your watchin' your back
Like you can't relax
You tryin' to be cool
You look like a fool to me
Tell me
Why the hell you have to go and make things so complicated?
I see the way you're, actin' like you're somebody else
Gets me frustrated
Life's like this you
You fall and you crawl and you break
And you take what you get, and you turn it into
Honestly, you promised me
I'm never gonna find you fake it
No no no
You come over unannounced
Dressed up, like you're somethin' else
Where you are ain't where it's at you see
You're makin' me
Laugh out, when you strike a pose
Take off, all your preppy clothes
You know, you're not foolin' anyone
When you become
Somebody else
'Round everyone else
Your watchin' your back
Like you can't relax
You tryin' to be cool
You look like a fool to me
Tell me
Why'd you have to go and make things so complicated?
I see the way you're actin' like you're somebody else
Gets me frustrated
Life's like this you
You fall and you crawl and you break
And you take what you get, and you turn it into
Honestly, you promised me
I'm never gonna find you fake it
No no no
(No no no)
No no
(No no no)
No no
(No no no)
No no
Ooh, chill out, what you yellin' for?
Lay back, it's all been done before
And if you could only let it be
You will see
Somebody else
'Round everyone else
Your watchin' your back
Like you can't relax
You tryin' to be cool
You look like a fool to me
Tell me
Why'd you have to go and make things so complicated?
I see the way you're actin' like you're somebody else
Gets me frustrated
Life's like this, you
You fall and you crawl and you break
And you take what you get, and you turn it into
Honestly, you promised me
I'm never gonna find you fake it
No no
Why'd you have to go and make things so complicated?
(Yea yea)
I see the way you're actin' like you're somebody else
Gets me frustrated
Life's like this you
You fall and you crawl and you break
And you take what you get, and you turn it into
Honestly, you promised me
I'm never gonna find you fake it
No no no
'''
miss_word = {',', '-', '\'', '\"', ':', '.', '?', '!', '(', ')', }
for i in miss_word:
word.replace(i, ' ')
words = word.lower().split()
key_words = {}
for i in set(words):
key_words[i] = words.count(i)
for i in {'a', 'too', 'in', 'of', 'will', 'the', 'and', 'are', 'with', 'to', 'said', 'as', 's'}:
if i in key_words:
key_words.pop(i)
sort_word = sorted(key_words.items(), key = lambda d:d[1], reverse = True)
for i in range(10):
print(sort_word[i])

转载于:https://www.cnblogs.com/swxvico/p/8645742.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值