1. 程式人生 > >完整中英文詞頻

完整中英文詞頻

學習班 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 Im a wolf in sheeps clothingCause at the end of the night
It is her Ill be holding

I love you so
Thats what youll say
Youll tell me
Baby baby please dont go away
But 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 Im a rolling stone So you better run run run away run away baby Well let me think let me think Ah what should I
do? So many eager young bunnys That Id like to pursue Now even now they eating out the palm of my hand Theres only one carrot and they all gotta share it I love you so Thats what youll say Youll tell me Baby baby please dont go away But 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 Im 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)))

技術分享圖片

技術分享圖片

技術分享圖片

技術分享圖片

完整中英文詞頻