示例#1
0
 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;
 }
示例#2
0
        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;
        }
示例#3
0
 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);
 }
示例#4
0
 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;
 }
示例#5
0
 public TextComparer(byte[] docHashes, SuffixArray suffixArray)
     : this(docHashes, 2, suffixArray)
 {
 }