是否有任何python模块(可能在nltk python中)来删除互联网俚语/聊天俚语,如"lol","brb"等。如果没有,谁能提供一份包含这么多俚语的CSV文件给我?
网站http://www.netlingo.com/acronyms.php给出了缩略词的列表,但我找不到任何CSV文件在我的程序中使用它们。
代码报废http://www.netlingo.com/acronyms.php
from bs4 import BeautifulSoup
import requests, json
resp = requests.get("http://www.netlingo.com/acronyms.php")
soup = BeautifulSoup(resp.text, "html.parser")
slangdict= {}
key=""
value=""
for div in soup.findAll('div', attrs={'class':'list_box3'}):
for li in div.findAll('li'):
for a in li.findAll('a'):
key =a.text
value = li.text.split(key)[1]
slangdict[key]=value
with open('myslang.json', 'w') as f:
json.dump(slangdict, f, indent=2)
-
The Jargon File: http://www.catb.org/jargon/.
-
凯文的单词列表页面:参见俚语单词列表和字典的链接