1.publish channel message:发布频道 publish news "hello" 发布消息到news 频道 2.subscribe channel [channel2] : 订阅频道(可以同时订阅多个频道) 3.unsubscribe channel [channel2] : ...
分类:
其他好文 时间:
2018-03-28 16:50:48
阅读次数:
151
import jieba news = open('bignews.txt','r').read() news_cut = jieba.lcut(news) dict = {} for i in set(news_cut): dict[i]=news_cut.count(i) delete={'的' ...
分类:
其他好文 时间:
2018-03-28 16:47:42
阅读次数:
133
下载一长篇中文文章。 从文件读取待分析文本。 news = open('gzccnews.txt','r',encoding = 'utf-8') 安装与使用jieba进行中文分词。 pip install jieba import jieba list(jieba.lcut(news)) 生成词频 ...
分类:
其他好文 时间:
2018-03-28 16:44:54
阅读次数:
123
题目: 下载一长篇中文文章。 从文件读取待分析文本。 news = open('gzccnews.txt','r',encoding = 'utf-8') 安装与使用jieba进行中文分词。 pip install jieba import jieba list(jieba.lcut(news)) ...
分类:
其他好文 时间:
2018-03-28 01:40:05
阅读次数:
209
1.英文词频统 下载一首英文的歌词或文章,将所有,.?!’:等分隔符全部替换为空格 将所有大写转换为小写,生成单词列表 生成词频统计 排序 排除语法型词汇,代词、冠词、连词 输出词频最大TOP20 将分析对象存为utf-8编码的文件,通过文件读取的方式获得词频分析内容。 读取news.txt文件: ...
分类:
其他好文 时间:
2018-03-28 01:26:44
阅读次数:
178
词频统计预处理 下载一首英文的歌词或文章 news = ''' She hangs out every day near by the beach . Havin’ a HEINEKEN fallin’ asleep She looks so sexy when she’s walking the ...
分类:
其他好文 时间:
2018-03-27 23:57:20
阅读次数:
222
下载一长篇中文文章。 从文件读取待分析文本。 news = open('gzccnews.txt','r',encoding = 'utf-8') 安装与使用jieba进行中文分词。 pip install jieba import jieba list(jieba.lcut(news)) 生成词频 ...
分类:
其他好文 时间:
2018-03-27 22:26:40
阅读次数:
223
字符串 字符串就是一个或多个排列在一起的字符,放在单引号或双引号之中。 'abc'"abc" length属性 js里的字符串类似于数组,都是一个一个字符拼凑在一起组成的,因此可以用length属性取得字符串的长度 var str = "hello"str.length; // 5 字符串常用的一些 ...
分类:
编程语言 时间:
2018-03-27 20:54:28
阅读次数:
202
file=open('tt.txt','r') news=file.read() myreplace=''',()!`%&*''' for i in myreplace: myreplace=myreplace.replace(i,' ') wordlist=news.lower().split()... ...
分类:
编程语言 时间:
2018-03-27 18:54:56
阅读次数:
185
android中出现这种情况,一般是在直接改现有的包名导致的。比如com.shone.news 改为com.ailin.news 其他地方都改了。但是不够彻底。漏掉了一个非常重要的地方 按照下图把包名改过来,保证没事 ...
分类:
移动开发 时间:
2018-03-27 18:51:35
阅读次数:
206