dkh.string
-
Declaration
struct SA(T);
-
Declaration
SA!T suffixArray(T)(in T[] _s, int B = 200);
return SA!T. each character must be inside [T(0), T(B)).
Examples
import std.algorithm : equal, map; string s = "abracadabra"; auto saInfo = s.suffixArray; assert(equal(saInfo.sa.map!(i => s[i..$]), [ "", "a", "abra", "abracadabra", "acadabra", "adabra", "bra", "bracadabra", "cadabra", "dabra", "ra", "racadabra", ]));