private void changeRules(Rules rules) {
    instance.rules = rules;
    instance.preBmBc = BoyerMoore.preBmBc(rules);
    instance.preBmGs = BoyerMoore.preBmGs(rules);
    instance.suffixes = BoyerMoore.suffixes(rules);

    preSkip = new HashMap<>();

    rules.forEach(
        rule -> {
          preSkip.put(rule, new ArrayList<>(Collections.nCopies(rule.getLength(), 0)));
        });
  }
Ejemplo n.º 2
0
  private void changeRules(Rules rules) {

    this.rules = rules;

    preBMBC = BoyerMoore.preBmBc(rules);
  }