DoubleArrayTrie(DAT)支持用C++实现Python的前缀搜索和精确搜索和多模式匹配

pydat的Python项目详细描述


##双数组

doubleArrayTrie(DAT)支持前缀搜索&;精确搜索&;C++实现的Python多模式匹配

###有什么不同

现在支持贪婪搜索: 函数search只返回最长的子序列(贪婪搜索) 函数最大值搜索 >返回所有子序列

word: she sher shers he to_search: shers

search: {‘entities’: [{‘begin’: 0, ‘end’: 5, ‘entity’: ‘shers’}]}

maximum_search: {‘entities’: [{‘begin’: 0, ‘end’: 3, ‘entity’: ‘she’}, {‘begin’: 0, ‘end’: 4, ‘entity’: ‘sher’}, {‘begin’: 0, ‘end’: 5, ‘entity’: ‘shers’}, {‘begin’: 1, ‘end’: 3, ‘entity’: ‘he’}]}

α+C++

#include “double_array_trie.h”

DoubleArrayTrie dat; // load from file dat.load_file(“test.txt”) // or add word dat.add_word(“he”) dat.add_word(“she”) // make base & check dat.make() // greedy_search vector<string> index_s = dat.search(“ushers”) // maximum_search vector<string> index_s = dat.maximum_search(“ushers”)

###Python

# install pip install pydat

# use dat = pydat.Dat() dat.load_file(“test.txt”) dat.add_word(“he”) dat.make() # search dat.search(“ushers”) # greedy_search dat.maximum_search(“ushers”)

###关于数据 啊![](https://linux.thai.net/~thep/datrie/double.gif

定义 检查[base[s]+c]=s 基[s]+c=t

引用:[双数组trie的实现](https://linux.thai.net/~thep/datrie/datrie.html#Double

###更新日志

####2018年9月19日 -优化算法

####2018年8月29日 -支持贪婪搜索

####2018年8月8日 -支持python3

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何解决选择组合框项时的错误   java如何在Weblogic 10.3.5中获取事务超时的堆栈跟踪   java从父类中调用父方法   java NamedParameterJdbcTemplate jconnect十进制问题   java使用SpringWebClient通过特定的网络接口发送http请求   java检查对象是否是类和强制转换列表中的类的实例   java制作web服务,采用哪种方法?   java聊天客户端socket和服务器socket并发   java自定义键盘仅在galaxy s6上崩溃+   java Jersey/JAXRS放置、删除程序员提供的或将由程序员完成的幂等性   Java浮点值格式   java使用toString递归打印节点及其成功者   Apache Beam的WebSocket连接器(Java)?   hibernate中的java对象不会强制转换   java AWSIotException:尝试附加策略时不允许跨帐户   java如何使用JNA获取静态最终变量