标签:
1、链表的连接
2、链表的索引
3、频率分布
4、字符串操作
s.istitle() 测试 s是否首字母大写( s中所有的词都首字母大写
5、for循环
sorted([item foritem in set(text6)if item.istitle()])
6、语法规则
所有的Python控制结构都以冒号结尾。冒号表示当前语句与后面的缩进块有关联
7、访问语料库
nltk.corpus.gutenberg.fileids()
//返回所有的文件名标识符 note:这里是对nltk.corpus进行研究,之前的text是对nltk中的九个文本进行的研究,
例如用text1.concordance()命令对文本内容进行检索,这里如果想像这样对文本进行操作,
则emma = nltk.Text(nltk.corpus.gutenberg.words(‘austen-emma.txt’))
emma.concordance(“surprize”)
标签:
原文地址:http://blog.csdn.net/u010378878/article/details/51352211