@Test public void testRankerReturnsEmptyWhenNoCandiates() { assertFalse(ranker.getTopCandidate(entityInformation, ImmutableSet.of()).isPresent()); }
@Override public Optional<Candidate> getTopCandidate( EntityInformation<T> entityInformation, Collection<Candidate> candidates) { SortedSet<? extends Candidate> ranked = rankedCandidates(candidates, entityInformation); if (ranked.isEmpty()) { return Optional.empty(); } else { return Optional.ofNullable(ranked.last()); } }
BagOfWordsCandidateRanker implements CandidateRanker<T> { @Override public Optional<Candidate> getTopCandidate( EntityInformation<T> entityInformation, Collection<Candidate> candidates) { SortedSet<? extends Candidate> ranked = rankedCandidates(candidates, entityInformation); if (ranked.isEmpty()) { return Optional.empty(); } else { return Optional.ofNullable(ranked.last()); } } }
BagOfWordsCandidateRanker implements CandidateRanker<T> { @Override public Optional<Candidate> getTopCandidate( EntityInformation<T> entityInformation, Collection<Candidate> candidates) { SortedSet<? extends Candidate> ranked = rankedCandidates(candidates, entityInformation); if (ranked.isEmpty()) { return Optional.empty(); } else { return Optional.ofNullable(ranked.last()); } }  }
BagOfWordsCandidateRanker implements CandidateRanker<T> { @Override public Optional<Candidate> getTopCandidate( EntityInformation<T> entityInformation, Collection<Candidate> candidates) { SortedSet<? extends Candidate> ranked = rankedCandidates(candidates, entityInformation); if (ranked.isEmpty()) { return Optional.empty(); } else { return Optional.ofNullable(ranked.last()); } }  @Override void initialize(Collection<String> stopwords); @Override Optional<Candidate> getTopCandidate(
      EntityInformation<T> entityInformation, Collection<Candidate> candidates); }
BagOfWordsCandidateRanker implements CandidateRanker<T> { @Override public Optional<Candidate> getTopCandidate( EntityInformation<T> entityInformation, Collection<Candidate> candidates) { SortedSet<? extends Candidate> ranked = rankedCandidates(candidates, entityInformation); if (ranked.isEmpty()) { return Optional.empty(); } else { return Optional.ofNullable(ranked.last()); } }  @Override void initialize(Collection<String> stopwords); @Override Optional<Candidate> getTopCandidate(
      EntityInformation<T> entityInformation, Collection<Candidate> candidates);  }