综合练习:词频统计

song='''
We were both young when I first saw you
I close my eyes and the flashback starts
Love Story
Love Story
I'm standing there on a balcony in summer air
See the lights see the party the ball gowns
See you make your way through the crowd
And say hello
Little did I know
That you were Romeo you were throwing pebbles
And my daddy said stay away from Juliet
And I was crying on the staircase
Begging you please don't go
And I said
Romeo take me somewhere we can be alone
I'll be waiting all there's left to do is run
You'll be the prince and I'll be the princess
It's a love story baby just say yes
So I sneak out to the garden to see you
We keep quiet cause we're dead if they knew
So close your eyes
Escape this town for a little while
Cause you were Romeo, I was a scarlet letter
And my daddy said stay away from Juliet
But you were everything to me
I was begging you please don't go
And I said
Romeo take me somewhere we can be alone
I'll be waiting all there's left to do is run
You'll be the prince and I'll be the princess
It's a love story baby just say yes
Romeo save me they're trying to tell me
How to feel
This love is difficult but it's real
Don't be afraid we'll make it out of this mess
It's a love story baby just say yes
I got tired of waiting
Wondering if you were ever coming around
My faith in you was fading
When I met you on the outskirts of town
And I said
Love Story
Love Story
Romeo save me I've been feeling so alone
I keep waiting for you but you never come
Is this in my head I don't know what to think
He knelt to the ground and pulled out a ring
And said
Marry me Juliet never have to be alone
I love you and that's all I really know
I talked to your dad go pick out a white dress
It's a love story baby just say yes
Oh oh oh oh oh oh
Cause we were both young when I first saw you
'''
symbol=[",",";",".","!","?","'",":","-"]
words=['t','ve','s','ll']
new_art=song
for i in range(len(symbol)):
    new_art=new_art.replace(symbol[i],'')

new_art=new_art.lower()
art_list=new_art.split()

dic = dict(zip())
for i in art_list:
    dic[i] = new_art.count(i)

转载于:https://www.cnblogs.com/darkhate/p/8649685.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值