Mercurial > hg > anteater
comparison src/de/mpiwg/anteater/results/impl/ApplicantResultFinder.java @ 0:036535fcd179
anteater
author | jdamerow |
---|---|
date | Fri, 14 Sep 2012 10:30:43 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:036535fcd179 |
---|---|
1 package de.mpiwg.anteater.results.impl; | |
2 | |
3 import java.util.List; | |
4 | |
5 import de.mpiwg.anteater.AnteaterConfiguration; | |
6 import de.mpiwg.anteater.ml.MLController; | |
7 import de.mpiwg.anteater.persons.regex.ApplicantRegexFinder; | |
8 import de.mpiwg.anteater.results.ApplicantResult; | |
9 import de.mpiwg.anteater.results.IResultFinder; | |
10 import de.mpiwg.anteater.text.TextInformation; | |
11 | |
12 public class ApplicantResultFinder implements IResultFinder<ApplicantResult> { | |
13 | |
14 private AnteaterConfiguration configuration; | |
15 | |
16 public ApplicantResultFinder(AnteaterConfiguration configuration) { | |
17 this.configuration = configuration; | |
18 } | |
19 | |
20 public List<ApplicantResult> getResults(List<TextInformation> infos) { | |
21 MLController mlController = new MLController(configuration); | |
22 ApplicantRegexFinder regexFinder = new ApplicantRegexFinder(configuration); | |
23 | |
24 List<ApplicantResult> mlApplicants = mlController.runApplicantMLComponent(infos); | |
25 List<ApplicantResult> regexApplicants = regexFinder.findApplicants(infos); | |
26 | |
27 MLApplicantLoop: for (ApplicantResult mlResult : mlApplicants) { | |
28 for (ApplicantResult regexResult : regexApplicants) { | |
29 if (regexResult.getFinding() == mlResult.getFinding()) | |
30 continue MLApplicantLoop; | |
31 } | |
32 regexApplicants.add(mlResult); | |
33 } | |
34 | |
35 return regexApplicants; | |
36 } | |
37 } |