正在寻找 C# 中的后缀树实现?
I've implemented a basic search for a research project. I'm trying to make the search more efficient by building a suffix tree. I'm interested in a C# implementation of the Ukkonen algorith. I don't want to waste time rolling my own if such implementation exists.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
难以回答的问题。 这是我能找到的最接近的匹配: http://www.codeproject.com/KB/ Recipes/ahocorasick.aspx,它是 Aho-Corasick 字符串匹配算法的实现。 现在,该算法使用后缀树状结构: http://en.wikipedia.org /wiki/Aho-Corasick_algorithm
现在,如果您想要一个前缀树,本文声称为您提供了一个实现:http://www.codeproject.com/KB/recipes/prefixtree.aspx <
幽默> 现在我已经完成了你的作业,你来修剪我的草坪怎么样? (参考:http://flyingmoose.org/tolksarc/homework.htm)/幽默>
编辑:我发现了一个 C# 后缀树实现,它是发布在博客上的 C++ 后缀树实现:http://code.google.com/p/csharsuffixtree/source/browse/#svn/trunk/suffixtree
编辑:Codeplex 有一个专注于后缀树的新项目:http://suffixtree.codeplex.com/
Hard question. Here's the closest to match I could find: http://www.codeproject.com/KB/recipes/ahocorasick.aspx, which is an implementation of the Aho-Corasick string matching algorithm. Now, the algorithm uses a suffix-tree-like structure per: http://en.wikipedia.org/wiki/Aho-Corasick_algorithm
Now, if you want a prefix tree, this article claims to have an implementation for you: http://www.codeproject.com/KB/recipes/prefixtree.aspx
<HUMOR> Now that I did your homework, how about you mow my lawn. (Reference: http://flyingmoose.org/tolksarc/homework.htm) </HUMOR>
Edit: I found a C# suffix tree implementation that was a port of a C++ one posted on a blog: http://code.google.com/p/csharsuffixtree/source/browse/#svn/trunk/suffixtree
Edit: There is a new project at Codeplex that is focused on suffix trees: http://suffixtree.codeplex.com/
嘿,刚刚完成包含不同 trie 实现的 .NET (c#) 库的实现。 其中:
我试图使源代码易于阅读。 用法也非常简单:
该库经过了充分测试,并且还作为 TrieNet NuGet 包发布。
请参阅 github.com/gmamaladze/trienet
Hei, just finished implementing .NET (c#) library containing different trie implementations. Among them:
I tried to make source code easy readable. Usage is also very straight forward:
The library is well tested and also published as TrieNet NuGet package.
See github.com/gmamaladze/trienet
这是一个相当有效的后缀树的实现。 我没有研究过 Ukkonen 的实现,但我认为这个算法的运行时间是相当合理的,大约是
O(N Log N)
。 请注意,创建的树中的内部节点数等于父字符串中的字母数。Here is an implementation of a suffix tree that is reasonably efficient. I haven't studied Ukkonen's implementation, but the running time of this algorithm I believe is quite reasonable, approximately
O(N Log N)
. Note the number of internal nodes in the tree created is equal to the number of letters in the parent string.