英语词频统计

Posted 夕颜凝熙

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了英语词频统计相关的知识,希望对你有一定的参考价值。

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])

以上是关于英语词频统计的主要内容,如果未能解决你的问题,请参考以下文章

Python语音实现词频统计

组合数据类型练习英语词频统计

组合数据类型练习英语词频统计

Java实现英语文章词频统计

组合数据练习,英语词频统计实例上

词频统计单元测试