---
title: "mova-parse-dispatch — Mova code model"
description: "Mova code model of tools/mova-parse/src/lib.rs: components with their labels, obernants and the model text."
url: "https://groupants.elamur.ai/free/en/mova/tools/mova-parse/src/lib.rs.groupant/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · [Research](https://md.research.elamur.ai/free/en/) · **Groupants**

This page as HTML: <https://groupants.elamur.ai/free/en/mova/tools/mova-parse/src/lib.rs.groupant/>

# mova-parse-dispatch

The groupant beside tools/mova-parse/src/lib.rs in the Mova repository: what the code computes, what it never does, how to go back from its outputs, its invariants, cost and checks.

## Facts

- **kind:** groupant
- **status:** partial source bound model
- **source:** [`tools/mova-parse/src/lib.rs`](https://github.com/ElamurAI/mova-free/blob/main/tools/mova-parse/src/lib.rs)
- **repository folder:** [`tools/mova-parse/src/lib.rs.groupant`](https://github.com/ElamurAI/mova-free/tree/main/tools/mova-parse/src/lib.rs.groupant)

> **Implementation material.** A Mova code model describes this code at one source revision: partial models, finite checks and their stated scope. It is not a reviewed general exposition, and its labels are shown as written, never raised.

## Components

| component | label | where |
|---|---|---|
| **Approximant** | partial | [Approximant](#approximant) |
| **Ast** | partial | `syntax.json` |
| **Cost** | symbolic source derived | [Cost](#cost) |
| **Descriptant** | present | [Descriptant](#descriptant) |
| **Invariant** | partial | [Invariant](#invariant) |
| **Tests** | executed bounded checks | [Tests](#tests) |

## Obernants

The typed relations around the forward model: the behaviour complement (what the code never does), the reverse reconstruction (every input compatible with an output) and specialised views.

| relation | type | label | where |
|---|---|---|---|
| Behavior complement | behavior complement | partial source derived model | [Behavior complement](#behavior-complement) |
| Reverse reconstruction | reverse reconstruction | partial source derived model | [Reverse reconstruction](#reverse-reconstruction) |
| Matrix composition | matrix composition | partial source derived model | [Matrix composition](#matrix-composition) |

## Model text


### Descriptant

The two-level dispatcher: sentences of a line; level 1 (`langseg::Segmenter` with the Latin table) gives language
spans; the pieces of the sentence's language are parsed together by its model, each longer switched piece by its own
model with its root on the matrix root (`dep`, `CSAttach=root`), short switched pieces inside the matrix parse marked
`CSParse=matrix`; a language without a model gets unannotated tokens with `Parse=None`. The CoNLL-U writer adds
`# lang`, `# dialect`, `# style`, `# parse`, `# spans`.
`sentence_as` / `parse_as` parse as one language the reader chose: one piece, level 1 not asked (the parse service's
language selector). The style tagger is `Send + Sync`, so a dispatcher is shared between threads.

### Approximant

`parse(text) = concat_lines concat_sentences sentence(s)`; `sentence(s) = compose(matrix(annotate_lang(tokens of
pieces with l = lang or short)), {annotate_l(tokens of piece) | l ≠ lang, long})`; `lang = argmax_l letters(l)`.

### Invariant

Every token comes from exactly one piece; pieces cover the sentence (first starts at 0, last ends at its length,
neighbours touch); no token of a language without a model gets a head; each annotated unit has its own tree, and only
a switched unit's root is re-attached; a French piece of `min_span` words or more never reaches the English model.

### Cost

Per sentence: level-1 `O(n·K)` plus each model's annotation on its unit (matrix once, each switched unit once).

### Behavior complement

It does not parse the attachment between a switched span and its matrix; it does not merge tokenizers; it does not
decide Hebrew-script varieties (no Hebrew-script model loaded) nor parse them; it does not fill the style without a
detector.

### Reverse reconstruction

The `# spans` line and `# text` recover the pieces; `Lang=`/`CSParse`/`CSAttach` recover the routing of each token; a
`# parse = none` sentence recovers only its tokens.

### Matrix composition

Removing switched spans from the matrix unit keeps the matrix clause contiguous for its parser; the cost is a lost
argument (the quote) in the matrix tree, which the placeholder `dep` edge marks.

### Tests

`sentences_and_pieces`, `no_model_is_reported_not_parsed`, `a_forced_language_skips_level_one` (with level 1 itself as
the control); a two-run identity check on 60 Global Voices lines
(2026-11-06).

## Provenance

- **source SHA-256:** `d2855d7c1321544a…`
- **repository commit:** `2e25d7bfae9a`
