code: @Override
      public int[] buildSuffixArray(int[] input, int start, int length) {
          Tools.assertAlways(input != null, "input must not be null");
          Tools.assertAlways(input.length >= start + length + KBS_STRING_EXTENSION_SIZE,
              "input is too short");
          Tools.assertAlways(length >= 2, "input length must be >= 2");
          this.start = start;
  
          if (preserveInput) {
  
              seq = new int[length + KBS_STRING_EXTENSION_SIZE];
              this.start = 0;
              System.arraycopy(input, start, seq, 0, length);
          } else {
              seq = input;
          }
  
          this.alphabet = new Alphabet(seq, length);
          this.length = length;
          int alphaSize = alphabet.size;
  
          int q;
          if (alphaSize <= 9) {
              q = 7;
          } else if (9 < alphaSize && alphaSize <= 13) {
              q = 6;
          } else if (13 < alphaSize && alphaSize <= 21) {
              q = 5;
          } else if (21 < alphaSize && alphaSize <= 46) {
              q = 4;
          } else {
              q = 3;
          }
  
          kbs_buildDstepUsePrePlusCopyFreqOrder_SuffixArray(q);
          return suffixArray;
      }
docs: {@inheritDoc}
  <p>
  Additional constraints enforced by BPR algorithm:
  <ul>
  <li>input array must contain at least {@link #KBS_STRING_EXTENSION_SIZE} extra
  cells</li>
  <li>non-negative (&ge;0) symbols in the input</li>
  <li>symbols limited by {@link #KBS_MAX_ALPHABET_SIZE} (&lt;
  <code>KBS_MAX_ALPHABET_SIZE</code>)</li>
  <li>length &ge; 2</li>
  </ul>
  <p>