Section navigation

Public classSealed OrdinalMap

Namespace
Rowles.LeanCorpus.Search.Scoring
Assembly
Rowles.LeanCorpus.dll

Maps sorted local ordinals from several readers into one stable, lexicographically ordered ordinal space.

public sealed class OrdinalMap
Inheritance
OrdinalMap

Remarks

Each source term list must be sorted with Ordinal and must not contain duplicates. The map is immutable after construction, so readers can share it across concurrent aggregation, grouping, and sorted-value operations.

Public property SourceCount

Gets the number of source ordinal spaces represented by this map.

Public property Terms

Gets the global terms in ordinal order.

Public property ValueCount

Gets the number of unique terms in the global ordinal space.

Public method Build(IReadOnlyList<IReadOnlyList<string>>)

Builds a map from one sorted, duplicate-free term list per source reader.

Public method GetGlobalOrdinal(int, int)

Gets the global ordinal for a source-local ordinal.

Public method GetTerm(int)

Gets the term represented by a global ordinal.

Public method TryGetGlobalOrdinal(int, string, out int)

Looks up a global ordinal by term in a source reader.