Method Fuse
- Namespace
- MailFathom.Application.Emails.Search
- Assembly
- MailFathom.Application.dll
Fuse(IReadOnlyList<RankedEmailCandidate>, IReadOnlyList<RankedEmailCandidate>, int)
Fuses a lexical ranking and a semantic ranking into one bounded ordering.
public static IReadOnlyList<RankedEmailCandidate> Fuse(IReadOnlyList<RankedEmailCandidate> lexicalCandidates, IReadOnlyList<RankedEmailCandidate> semanticCandidates, int limit)
Parameters
lexicalCandidatesIReadOnlyList<RankedEmailCandidate>The lexical ranking, best first.
semanticCandidatesIReadOnlyList<RankedEmailCandidate>The semantic ranking, nearest first.
limitintThe greatest number of fused results to return, at least one.
Returns
- IReadOnlyList<RankedEmailCandidate>
At most
limitcandidates, best fused score first, each carrying that score.
Remarks
The place a candidate holds is its index in the sequence it arrived in, so a caller passes each ranking in the order its producer returned rather than sorting it first. A candidate appearing twice within one ranking is scored at its best place there, because a duplicate would otherwise let one ranking cast two votes.
Exceptions
- ArgumentNullException
Thrown when either ranking is null.
- ArgumentOutOfRangeException
Thrown when
limitis below one.