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
  @Override
  public void search(Input input, Results results, int runNumber, String runId) {
    Result result = new Result(rules, input, this, runNumber, runId);
    result.start();

    int n = input.getLength();

    List<Runnable> runnables = new ArrayList<>();

    rules.forEach(
        rule -> {
          Runnable runnable = new RaitaRunnable(input, result, n, rule);
          runnables.add(runnable);
        });

    executeSearch(runnables);

    result.end();
    results.addResult(result);
  }