Esempio n. 1
0
 public static <T extends QueryMatch> ValidatorResults<T> validate(
     Monitor monitor, Iterable<ValidatorDocument<T>> documents, MatcherFactory<T> matcherFactory)
     throws IOException {
   ValidatorResults<T> results = new ValidatorResults<>();
   for (ValidatorDocument<T> doc : documents) {
     Matches<T> matches = monitor.match(doc.getDocument(), matcherFactory);
     results.add(matches, doc.getDocument().getId(), doc.getExpectedMatches());
   }
   return results;
 }
Esempio n. 2
0
 public static <T extends QueryMatch> BenchmarkResults<T> run(
     Monitor monitor,
     Iterable<InputDocument> documents,
     int batchsize,
     MatcherFactory<T> matcherFactory)
     throws IOException {
   BenchmarkResults<T> results = new BenchmarkResults<>();
   for (DocumentBatch batch : batchDocuments(documents, batchsize)) {
     Matches<T> matches = monitor.match(batch, matcherFactory);
     results.add(matches);
   }
   return results;
 }