Table of Contents

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

lexicalCandidates IReadOnlyList<RankedEmailCandidate>

The lexical ranking, best first.

semanticCandidates IReadOnlyList<RankedEmailCandidate>

The semantic ranking, nearest first.

limit int

The greatest number of fused results to return, at least one.

Returns

IReadOnlyList<RankedEmailCandidate>

At most limit candidates, 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 limit is below one.