日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 综合教程 >内容正文

综合教程

综合练习

發布時間:2023/12/19 综合教程 37 生活家
生活随笔 收集整理的這篇文章主要介紹了 综合练习 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

詞頻統計預處理
下載一首英文的歌詞或文章
將所有,.?!’:等分隔符全部替換為空格
將所有大寫轉換為小寫
生成單詞列表
生成詞頻統計
排序
排除語法型詞匯,代詞、冠詞、連詞
輸出詞頻最大TOP10

 text="No matter how many characters are available for your password you should be sure to use every one of them. The more characters available for your password and the more you use makes it that much harder to figure out the combination. Always make use of all characters available for a strong and secure password.Personal information such as names, birthdays, nicknames, pet's names, social security numbers, and the like should never, ever, ever be used because these are way too obvious and too easy to crack. The more you avoid using things like this as your passwords, the more secure your login areas will be."
sym=[',','.','!','?','’',':','$','%']
word= ['a','in','of','the','to','at','it','on','and','so','his','that',
        'not','was','my','were','we','he','an','as','is','for','mr','us']
new_text=text
for i in range(len(sym)):
	new_text=new_text.replace(sym[i],'')
new_text=new_text.lower()
text_list=new_text.split()
d=dict(zip())
for i in text_list:
	d[i]=new_text.count(i)

	
for i in word:
	if(d.get(i)!=None):
		d.pop(i)


new_d=sorted(d.items(),key=lambda x:x[1],reverse=True)
for i in range(10):
	print(new_d[i])

總結

以上是生活随笔為你收集整理的综合练习的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。