senti_rule.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:TextClassification 作者: mosu027 项目源码 文件源码
def splitWord(self, content):

        segs = pseg.cut(str(content))
        result = []
        for word,type in segs:
            WORD = Word()
            if self.wordtypeDict.has_key(word):
                WORD.setword(word)
                WORD.settype(self.wordtypeDict[word])
                WORD.setfreq(self.wordfreqDict[word])
            else:
                WORD.setword(word)
                WORD.settype(type)
                result.append(WORD)
            # print "word ", word
            result.append(WORD)
        return result
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号