完整中英文詞頻
阿新 • • 發佈:2018-09-27
學習班 read only ict 計算 pretty art hand spl
strRun=‘‘‘Well looky here looky here Ah what do we have? Another pretty thang ready for me to grab But little does she know That I‘m a wolf in sheeps clothing ‘Cause at the end of the night It is her I‘ll be holding I love you so That‘s what you‘ll say You‘ll tell me Baby baby please don‘t go awayBut when I play, I never stay To every girl that I meet here this is what I say: Run run run away, run away baby Before I put my spell on you You better get get get away get away darling ‘Cause everything you heard is true Your poor little heart will end up alone ‘Cause lord knows I‘m a rolling stone So you better run run run away run away baby Well let me think let me think Ah what should Ido? So many eager young bunny‘s That I‘d like to pursue Now even now they eating out the palm of my hand There‘s only one carrot and they all gotta share it I love you so That‘s what you‘ll say You‘ll tell me Baby baby please don‘t go away But when I play, I never stay To every girl that I meet herethis is what I say: Run run run away, run away baby Before I put my spell on you You better get get get away get away darling ‘Cause everything you heard is true Your poor little heart will end up alone ‘Cause lord knows I‘m a rolling stone So you better run run run away run away baby‘‘‘ strList = strRun.split() print(len(strList), strList) strListSort=strList.sort() print(strListSort) print(strList) sep=‘.,:?!‘ for x in sep: j=strRun.replace(x,‘‘) print(strRun) strSet=set(strList) exclude={"a","the","to","at"} st=strSet-exclude print(len(st),strSet) strDict = {} for word in strSet: strDict[word] = strList.count(word) print(len(strList),strList) fo=open("英文歌詞.txt","r",encoding=‘utf-8‘) Run=fo.read() fo.close() print(Run) import jieba k=‘美國時代周刊電腦學習班電腦軟甲學習計算機學習真的身份證號專業翻譯‘ print(list(jieba.cut(k))) print(list(jieba.cut(k,cut_all=True))) print(list(jieba.cut_for_search(k))) fo1=open("水滸傳.txt","r",encoding=‘utf-8‘) Run=fo1.read() fo1.close() print(Run) print(list(jieba.cut(Run))) print(list(jieba.cut(Run,cut_all=True))) print(list(jieba.cut_for_search(Run)))
完整中英文詞頻