BWT any suggestions to improve this?

已查看 279 次
跳至第一个未读帖子

Dan Kortschak

未读,
2013年10月9日 02:37:322013/10/9
收件人 golan...@googlegroups.com
I was just having a play implementing a simple BWT code.

Here's what I came up with: http://play.golang.org/p/coOUXB_g07

Any suggestions to improve this?

Dan

Dan Kortschak

未读,
2013年10月9日 08:50:262013/10/9
收件人 Dan Kortschak、golan...@googlegroups.com

Ingo Oeser

未读,
2013年10月13日 19:04:462013/10/13
收件人 golan...@googlegroups.com、Dan Kortschak
Hi Dan,

On Wednesday, October 9, 2013 2:50:26 PM UTC+2, kortschak wrote:
A little more polish: http://play.golang.org/p/HV2DFUyHkY

You can fold the equality into the else path, because you already return true, after the if triggers 
and the compare won't change the result anymore.


Best Regards

Ingo

Ingo Oeser

未读,
2013年10月13日 19:13:032013/10/13
收件人 golan...@googlegroups.com、Dan Kortschak
It get's even more simple:

Dan Kortschak

未读,
2013年10月13日 19:25:522013/10/13
收件人 Ingo Oeser、golan...@googlegroups.com
Yeah, I've been working on it, but not sending here. It gets even
simpler - something I have from last week:

http://play.golang.org/p/kEi1PyS-Wh

Dan

Dan Kortschak

未读,
2013年10月13日 19:29:362013/10/13
收件人 Ingo Oeser、golan...@googlegroups.com
And merging in some of the things you had:

http://play.golang.org/p/eLzHRXJosP

Dan Kortschak

未读,
2013年10月13日 19:33:582013/10/13
收件人 Ingo Oeser、golan...@googlegroups.com
Now with added concision:

http://play.golang.org/p/yHn_4fDGPS

Robert Syme

未读,
2013年12月16日 02:31:592013/12/16
收件人 golan...@googlegroups.com、Ingo Oeser
If you are happy to borrow from stdlib, the index/suffixarray package contains code that will generate a suffix array very quickly (n log n). The important functions are not exported, so they are copied in the example below.

Once you have the suffix array, it's not difficult to generate the bwt:
回复全部
回复作者
转发
0 个新帖子