Sangeetha-Grantha

Metadata Value
Status Completed
Version 1.0.0
Last Updated 2026-03-20
Author Sangeetha Grantha Team

Track: Filter Standalone “Back” Link Text as Boilerplate

ID: TRACK-103 Status: Not Started Owner: Sangita Grantha Architect Created: 2026-03-20 Updated: 2026-03-20 Parent: TRACK-093 (Trinity Krithi Import)

Goal

Add standalone “Back” text to the boilerplate filter in StructureParser._is_boilerplate(). Dikshitar blog pages include “Back” navigation links between script sections that currently leak into lyric text.

Context

Analysis

Verified Code Path

  1. _build_blocks() (line 315) calls _is_boilerplate() for each non-empty line (line 334)
  2. _is_boilerplate() (line 878) checks lowered against a list of marker strings
  3. The marker list (lines 898-912) includes "link to this post", "newer post", "older post" etc.
  4. No check for standalone "back" — the string "back to" would only match if followed by more text
  5. Dikshitar pages have standalone "Back" text (from <a>Back</a> navigation links) between every script section

Fix

Add to _is_boilerplate():

if lowered == "back":
    return True

This is a standalone-line-only check (exact match on "back") to avoid false positives where “back” appears within legitimate lyric text.

Also add "Meaning of Kriti" navigation link pattern — the report notes Dikshitar pages have "Meaning of Kriti-1" style links:

if re.match(r"^meaning of kriti", lowered):
    return True

Implementation Plan

Phase 1: Fix

Phase 2: Testing & Validation

Design Considerations

Using exact match (lowered == "back") is safer than substring match to avoid false positives. The word “back” is unlikely to appear as a standalone lyric line in Carnatic compositions.

Acceptance Criteria

Dependencies

Files to Modify