Exemple #1
0
 /// <summary>Initialezas static member.</summary>
 /// <param name="wordLength">The length of word.</param>
 /// <param name="mismatchCount">The number of acceptable mismatches</param>
 public static void Init(byte wordLength, byte mismatchCount)
 {
     _wordLength    = wordLength;
     _wordLastIndex = (byte)(wordLength - 1);
     _count         = (int)Math.Pow(Chars.Count, wordLength);
     Similars.Init(mismatchCount);
     // inizialise words
     _wordsTrain = new byte[_count * wordLength];
     SetRank_recurs(0, 1);
 }
Exemple #2
0
        /// <summary>Initialezas static member.</summary>
        /// <param name="wordLength">The length of word.</param>
        /// <param name="mismatchCount">The number of acceptable mismatches</param>
        /// <param name="isTurbo">True if Turbo mode is defined.</param>
        public static void Init(byte wordLength, byte mismatchCount, bool isTurbo)
        {
            bool isDifferentLength = _wordLength != wordLength;

            if (isDifferentLength)
            {
                _wordLength    = wordLength;
                _wordLastIndex = (byte)(wordLength - 1);
                _count         = GetCount(wordLength);
            }
            Similars.Init(mismatchCount, isTurbo, isDifferentLength);   // _wordLength & _count are used in that method, so it could be the last
        }