zoukankan      html  css  js  c++  java
  • 综合练习:词频统计

    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)

  • 相关阅读:
    在ubuntu8.04上用evolution蒙受163邮件
    软件史上最宏大的法度员之Linux之父
    试用 Deluge 的 Web 界面
    在Ubuntu 8.04里把Firefox 3Beta5晋级到RC1
    Linux 对象箱 — 文件治理器 [17 款]
    现在的Linux不该该是小朋友的全国
    奉行LINUX的方案
    运用 Kompare 比力文件
    最好不要装64位的Linux
    Ubuntu安放telnet进程
  • 原文地址:https://www.cnblogs.com/darkhate/p/8649685.html
Copyright © 2011-2022 走看看