Пример #1
0
  private void ukkonenExtendSuffixTree(int arrayIdx) {
    logger.entering("UkkonenSuffixTree", "ukkonenExtendSuffixTree");
    logger.log(Level.FINEST, String.format("Ukkonen Algorithm String #%d", arrayIdx));

    TreeString string = strings.get(arrayIdx);
    extState = new UkkonenState(string);

    logger.log(
        Level.FINEST,
        String.format("Ukkonen: (%d,%d)", extState.nextPhaseStart, extState.string.length()));

    for (int phase = extState.nextPhaseStart; phase < extState.string.length(); phase++) {
      ukkonenSPA(phase);

      System.err.println(String.format("Phase %d results: ", phase));
      print(System.err);
      System.err.println();
      System.err.flush();
    }

    logger.log(Level.FINEST, String.format("Finishing edges: %d", extState.lastE));
    extState.finishFinalEdges();

    System.err.println(String.format("Finished results: "));
    print(System.err);
    System.err.println();
    System.err.flush();

    logger.exiting("UkkonenSuffixTree", "ukkonenExtendSuffixTree");
  }
Пример #2
0
  private void naiveExtendSuffixTree(int arrayIdx) {
    TreeString string = strings.get(arrayIdx);

    // the array.length-1 constraint, instead of array.length, is because
    // we assume that the terminal character has already been added to the
    // string, and we don't want to *just* add the suffix that is that
    // character.
    for (int i = 0; i <= string.length(); i++) {
      logger.log(
          Level.FINEST,
          String.format("Naive Extension: \"%s\"", string.substring(i, string.length() + 1)));

      naiveExtendSuffix(string, i);
    }
  }
Пример #3
0
 public TreeString getString(int i) {
   return strings.get(i);
 }