![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python学习
starryj
还没想好怎么写
展开
-
python KMP
import time def kmp_next(pattern): """得到部分匹配表 A B C D A B D 0 0 0 0 1 2 0""" index = [int(0)] for i in range(1, len(pattern)): pa = pattern[:i + 1] if pa[0] == pa原创 2017-03-27 21:08:15 · 416 阅读 · 0 评论 -
python BM
s = 'HERE IS A SIMPLE EXAMPLE' p = 'EXAMPLE' #s = 'qazwsxetgbdcrfvtgbatgb' #p = 'tgbatgb' d2 = 0 def bm(s, p): global d2 n = len(s) m = len(p) # print(n, m) j = int(m) - 1 i =原创 2017-04-01 15:44:17 · 778 阅读 · 0 评论 -
python 词云
生成你自己的词云#!/usr/bin/env python3 # -*- coding:utf-8 -*- ''' -author : starryj ''' import jieba from wordcloud import WordCloud, STOPWORDS, ImageColorGenerator import matplotlib.pyplot as plt from PIL imp原创 2017-04-11 18:10:51 · 2509 阅读 · 0 评论