Skip to main content

Class: TopicAggregationService

Defined in: Services/StudyOverview/TopicAggregationService.ts:28

Default implementation of ITopicAggregationService.

Does the expensive bulk-read + parent-chain + recursive-count pre-computation once per module at construction time. Per-chapter calls are cheap dictionary walks.

Use TopicAggregationService.from to build the service from repositories — this matches the script's preComputeTopicalData flow exactly so output is byte-equivalent to the legacy generation path.

Implements

Methods

getChapterTopics()

getChapterTopics(book, chapter): TopicsByVerse

Defined in: Services/StudyOverview/TopicAggregationService.ts:156

Build the verse-keyed topic dictionary for a single chapter. Modules are visited in array order; output preserves that order.

Parameters

book

number

chapter

number

Returns

TopicsByVerse

Implementation of

ITopicAggregationService.getChapterTopics


getPrecomputedModules()

getPrecomputedModules(): readonly PrecomputedTopicalModule[]

Defined in: Services/StudyOverview/TopicAggregationService.ts:152

Read-only access to the per-module pre-computed data (for logging/diagnostics).

Returns

readonly PrecomputedTopicalModule[]


from()

static from(modules): TopicAggregationService

Defined in: Services/StudyOverview/TopicAggregationService.ts:35

Build the service from a list of topical-index repositories. Performs the one-time bulk read and pre-computation per module.

Parameters

modules

AggregationModule<ITopicalIndexRepository>[]

Returns

TopicAggregationService


precomputeOne()

static precomputeOne(mod): PrecomputedTopicalModule

Defined in: Services/StudyOverview/TopicAggregationService.ts:45

Precompute topical data for a single module. Exposed as a static helper so callers (like the cache-generation script) can log progress per module before constructing the full service.

Parameters

mod

AggregationModule<ITopicalIndexRepository>

Returns

PrecomputedTopicalModule