alignment

Get Sentence Alignment

Get all sentence-level (逐句) parallels for one juan.

Phase 4 Package C read path for the future reader's sentence-by-sentence parallel view. Thin adapter over services.alignment_read_model.get_sentence_parallels (the direction-agnostic read of sentence_alignments lives there); this handler only maps records to the wire shape and enforces the dark-ship gate.

Frozen response contract (mirrors the chunk endpoints for client.ts):

{
  "text_id": int, "juan_num": int, "total": int,
  "pairs": [
    {
      "side_a": {"char_start", "char_end", "lang", "text"},   # requested text
      "side_b": {"text_id", "juan_num", "char_start", "char_end",
                 "lang", "title", "text"},                    # counterpart
      "similarity": float,        # averaged cross-lingual cosine
      "align_type": str,          # '1-1' | '1-2' | '2-1'
      "method": str,
      "is_verified": bool
    }
  ]
}

Ships DARK behind settings.enable_sentence_parallels (default False): the flag being off short-circuits to an empty payload WITHOUT touching the DB. Even with the flag on, an empty sentence_alignments table naturally yields total=0 / pairs=[] — the endpoint never errors, and self-activates once the flag is on AND prod's refine_sentence_alignments.py has populated rows.

get/api/alignment/sentences/{text_id}/{juan_num}

Request

  • Base URL: https://fojin.app (the document declares no server; this is the origin it was published from)
  • URL: https://fojin.app/api/alignment/sentences/{text_id}/{juan_num}
  • Auth: none declared

Path parameters

text_idinteger required
juan_numinteger required

Query parameters

limitinteger

Response

Successful Response

text_idinteger required
juan_numinteger required
totalinteger required

Changes

No recorded changes to this operation across all 1 revision of this API.