摘要:
>>> def gender_features(word):... return {'last_letter': word[-1]}>>> gender_features('Shrek'){'last_letter': 'k'}>>> from nltk.corpus import names>>> import random>>> names = ([(name, 'male') for name in names.word 阅读全文
posted @ 2014-03-25 12:01 wintor12 阅读(478) 评论(0) 推荐(0) 编辑