Multi-Pattern Matching Algorithms 多模式匹配算法
Project description
For Python2.5 use multi_pattern_search/cpp/compile.sh then cp so to python
site-packages
Engling Example:
from multi_pattern_search import MultiPatternSearch
search = MultiPatternSearch()
search.add_keyword("zsp")
search.add_keyword("my")
print search.exist("sdfgasg sadgfa zsp my ")
for k, v in search.count("my zsp ewtawt my zsp wat233").iteritems():
print k.decode('utf-8'), v
中文演示:
#coding=utf-8
from multi_pattern_search import MultiPatternSearch
search = MultiPatternSearch()
search.add_keyword("张沈鹏")
search.add_keyword("我是")
print search.exist("asdga sddqbq 珍珠饰张沈鹏品 ")
for k, v in search.count("我是张沈鹏.我是张沈鹏.我是张沈鹏.我是张沈
鹏.").iteritems():
print k.decode('utf-8'), v
site-packages
Engling Example:
from multi_pattern_search import MultiPatternSearch
search = MultiPatternSearch()
search.add_keyword("zsp")
search.add_keyword("my")
print search.exist("sdfgasg sadgfa zsp my ")
for k, v in search.count("my zsp ewtawt my zsp wat233").iteritems():
print k.decode('utf-8'), v
中文演示:
#coding=utf-8
from multi_pattern_search import MultiPatternSearch
search = MultiPatternSearch()
search.add_keyword("张沈鹏")
search.add_keyword("我是")
print search.exist("asdga sddqbq 珍珠饰张沈鹏品 ")
for k, v in search.count("我是张沈鹏.我是张沈鹏.我是张沈鹏.我是张沈
鹏.").iteritems():
print k.decode('utf-8'), v
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
multi_pattern_search-1.0.0.tar.gz
(20.3 kB
view hashes)
Close
Hashes for multi_pattern_search-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b09c82e5156ab2293f1f3ac7554583718b8704262e2467e7a69a4905840d75c7 |
|
MD5 | 2f4820a3280148d525a981aa9d057191 |
|
BLAKE2b-256 | 58c0fb042376442cc2ab98a2308bb00e4e66e9fb6a802f4faf99bf84b2534e9e |