J•JEV Field Guide
Home/Jev structure recovery: preserve text, rebuild Markdown

After the basics · Worked guides

Jev structure recovery: preserve text, rebuild Markdown

Restore a damaged event notice using line joins, block labels, provenance, and safe rendering.

Source checked 2026-10-0215 minutes
What you will build

Recover readable structure while retaining the original lines and uncertain decisions.

Before you start · How to design Jev state: from raw text to usable facts

Design it step by step

01

Keep an immutable source snapshot

Store line IDs, original characters, and blank-line metadata for an invented notice. Record whitespace normalization. Formatting restoration must not silently invent dates, prices, or sentences.

02

Parse explicit markers first

Handle headings, list markers, and code fences with deterministic parsing. Preserve command and table boundaries; a number in a sentence is not automatically a list item.

03

Judge only unclear line relationships

Ask whether an adjacent line continues an interrupted sentence, not merely whether the lines are related. Two registration lines may be different clauses. Separate semantic decisions from text joining.

04

Classify blocks after they exist

Choice can label formed blocks as headings, prose, lists, or code. This stage depends on previous joins. Code adds Markdown markers and keeps block-to-line provenance for reversal.

05

Check integrity and display separately

Compare numbers, dates, links, and commands with the source, then inspect headings and mobile layout. Escape HTML and prevent source scripts from executing. Invented “120” remains source text, not a generated replacement.

Worked example · Invented by this site

ObservationJudgmentApplication action
“Please register” plus “by Friday”Possible sentence continuationJoin with source IDs
“Fee 120” plus “Non-refundable”Related, possibly separate clausesPreserve or review the boundary
Source contains HTMLContent is not executable authorityEscape before display

A copyable design draft

Original examples. JSON illustrates request or input structure; Python calculates invented scores without an API call. Verify current interfaces and task policy before integrating.

# Offline provenance and safe-display example.
from html import escape
lines = {"L1": "Workshop notice", "L2": "Register by Friday."}
block = {"id": "B1", "source_ids": ["L2"], "kind": "paragraph"}
text = " ".join(lines[line_id] for line_id in block["source_ids"])
print(escape(text))  # Register by Friday.
# Joining and classification judgments are not performed here.
Design a decision

Common mistakes

  1. Joining based on topical similarity.
  2. Replacing source text with generated prose.
  3. Executing HTML from restored documents.

TRY / THINK / COMPARE

Think first, then compare

Two lines concern the event, but one is a refund clause. Join automatically?

Show explanation

No. Test sentence continuation and retain clause boundaries; preserve uncertain text for review.

Before handing it over

  • Source snapshots and line IDs retained.
  • Joining, block labeling, and rendering separated.
  • Numbers and links compared.
  • Rendered content escaped.

Common questions

Can you guarantee identical characters?

Define whitespace handling and validate content; this page is not a live model test.

Should OCR corrections be included?

Treat correction as a separate task with its own review.

Sources and further reading

Inspired by official patterns and Datawhale practice topics. Explanations, examples, and exercises are independently written. These are teaching designs, not live API runs or benchmarks.