build_tools.syllable_walk_web.services.metrics

Corpus metrics service for the web application.

Computes inventory, frequency, feature saturation, and terrain metrics for the analysis screen.

Functions

compute_analysis(annotated_data, frequencies)

Compute corpus analysis metrics for a patch.

Module Contents

build_tools.syllable_walk_web.services.metrics.compute_analysis(annotated_data, frequencies)[source]

Compute corpus analysis metrics for a patch.

Parameters:
  • annotated_data (Sequence[dict[str, Any]]) – Annotated syllable records.

  • frequencies (dict[str, int]) – Syllable frequency map.

Returns:

JSON-serialisable dict with inventory, frequency, terrain metrics.

Return type:

dict[str, Any]