Skip to main content

Crate sim_codec_doc

Crate sim_codec_doc 

Source
Expand description

Document domain codec for SIM.

Provides codec:doc, a domain decoder/encoder pair that turns document text (plain or Markdown) into a structured document Expr and back, plus provenance-preserving chunk operations exposed as callable functions. As a domain codec it round-trips only documents and chunks and fails closed outside that domain.

Module map (all modules are private; the public surface is re-exported from this crate root):

  • codec: the DocCodec decoder/encoder, the DocCodecLib host lib, and install_doc_codec.
  • document: the document model (DocValue, DocFormat, DocBlock, DocChunk, ChunkOp), decode_document, and the chunk operation.
  • functions: the doc/chunk-* chunking functions registered as callables.

Structs§

DocBlock
One parsed span of a document, carrying its byte offsets and the heading path in effect where it appears.
DocChunk
A provenance-preserving slice of a document produced by chunk.
DocCodec
The codec:doc decoder/encoder.
DocCodecLib
The host-registered Lib that installs DocCodec as codec:doc and the doc/chunk-* chunking functions.
DocValue
A decoded document: its full source text, detected format, and the ordered DocBlocks parsed from it.

Enums§

ChunkOp
A chunking strategy selecting how chunk splits a DocValue.
DocBlockKind
The category of a DocBlock.
DocFormat
The detected surface format of a decoded document.

Statics§

RECIPES
Cookbook recipes embedded from this crate’s recipes/ directory.

Functions§

chunk
Split a decoded doc into DocChunks according to op.
decode_document
Parse document text into a DocValue, recording per-block byte offsets and heading paths.
install_doc_codec
Install DocCodecLib into cx, registering codec:doc and the doc/chunk-* functions with a freshly allocated codec id.