defaultdict使用及__missing__理解
import collectionsimport reWORD_RE = re.compile(r'\w+')index = collections.defaultdict(list) #用list方法作为默认工厂创建一个默认字典with open('xx.txt',encoding='utf-8') as fp: for line_no,line in en...