public static SuffixArray BuildOne(Nucleotide[] fragments) { var tmp = new byte[fragments.Length + 1]; for (int i = 0; i < fragments.Length; i++) tmp[i] = (byte)fragments[i]; tmp[tmp.Length - 1] = (byte)Nucleotide.End; var sfx = new SuffixArray(tmp); return sfx; }
public TextComparer(byte[] docHashes, int minSubstrLength, SuffixArray suffixArray = null) : base(docHashes) { // _depths = new int[docHashes.Length]; // _srcIds = new int[docHashes.Length]; _suffixArray = suffixArray; DocHashesLength = _docHashes.Length; }
public static TextComparer BuildMany2(ICollection<Nucleotide[]> fragments, int minGroupSize = 0) { var tmp = new byte[fragments.Count + fragments.Sum(p => p.Length)]; int i = 0; foreach (var fragment in fragments) { foreach (var nucleotide in fragment) tmp[i++] = (byte)nucleotide; tmp[i++] = (byte)Nucleotide.End; } tmp[i - 1]++; var sfx = new SuffixArray(tmp, minGroupSize); return new TextComparer(tmp, sfx); }
public static SuffixArray BuildMany(ICollection<Nucleotide[]> fragments) { var tmp = new byte[fragments.Count + fragments.Sum(p => p.Length)]; int i = 0; foreach (var fragment in fragments) { foreach (var nucleotide in fragment) tmp[i++] = (byte) nucleotide; tmp[i++] = (byte)Nucleotide.End; } tmp[i - 1]++; var sfx = new SuffixArray(tmp); return sfx; }
public TextComparer(byte[] docHashes, SuffixArray suffixArray) : this(docHashes, 2, suffixArray) { }