我把wikipedia的扩展页面压缩成python字典(见下文)
请注意,如您所料,在查询字典时,您一定要使用双引号:
另外,我在维基百科页面中留下了多个选项。你可以随意修改它。注意,对右展开的消歧将是一个棘手的问题!contractions = {
"ain't": "am not / are not / is not / has not / have not",
"aren't": "are not / am not",
"can't": "cannot",
"can't've": "cannot have",
"'cause": "because",
"could've": "could have",
"couldn't": "could not",
"couldn't've": "could not have",
"didn't": "did not",
"doesn't": "does not",
"don't": "do not",
"hadn't": "had not",
"hadn't've": "had not have",
"hasn't": "has not",
"haven't": "have not",
"he'd": "he had / he would",
"he'd've": "he would have",
"he'll": "he shall / he will",
"he'll've":