Skip to main content

Multi-Pattern Matching Algorithms 多模式匹配算法

Project description

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
multi_pattern_search-1.2.3.tar.gz (20.2 kB) Copy SHA256 hash SHA256 Source None Apr 25, 2010

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page