unimsg provisional

examples/morphology.umsg

%unimsg 0 lang/ar/broken-plurals/v0 · 130 lines · 4282 bytes of text · 2217 bytes canonical · the raw file

Point at anything below — a sigil, a literal, a brace — and the card says what it is. Keyboard: tab through the document. Every explanation is also printed in full beneath the source.

%unimsg 0 lang/ar/broken-plurals/v0

-- A fragment of the Arabic broken plural system, modelled as a GENERATOR
-- plus RESIDUALS rather than as an enumeration of forms.
--
-- The distinction matters: a materialised paradigm is a photograph of a
-- theory at one moment, whereas rules plus exceptions ARE the theory, and a
-- correction propagates instead of needing thousands of edits.
--
-- Linguistic content is illustrative and needs review by a morphologist.
-- The shape of the modelling is the point, not the data.

uses { ling/ipa #sha256:6c82f1a9 }

-- Patterns are templates: a formula from a consonantal root to a surface
-- form. Inert data — nothing evaluates them at read time.
patterns {
  fiʿāl {
    arab     :فِعَال
    skeleton [ :C1, :I, :C2, , :C3 ]
    class    :singular
  }
  fuʿul {
    arab     :فُعُل
    skeleton [ :C1, :U, :C2, :U, :C3 ]
    class    :plural
    kind     :broken
    number   :multitude
    triptote true
  }
  ʾafʿāl {
    arab     :أَفْعَال
    skeleton [ , :A, :C1, "∅", :C2, , :C3 ]  -- ∅ is a math symbol, so quoted
    class    :plural
    kind     :broken
    number   :paucity
    triptote true
    note     "paucity sense weakly observed in modern usage"
  }
  mafāʿil {
    arab     :مَفَاعِل
    class    :plural
    kind     :broken
    stem     :quadriconsonantal
    triptote false
  }
}

-- Rules are general. A rule and an exception are the same kind of object:
-- they differ only in how many lexemes they cover.
rules [
  | id        singular  plural   conditions              confidence
  | :r-001    -> @patterns.fiʿāl -> @patterns.fuʿul  [ :sound-root ]       0.82
  | :r-002    -> @faʿal -> @patterns.ʾafʿāl [ :sound-root ]       0.61
  | :r-003    -> @fāʿil -> @fuʿʿāl [ :human, :agentive ] 0.74
  ]

-- Dimensions are declared value spaces with their own provenance, not bare
-- strings. Without this, "formal" and "Formal" drift apart across thousands
-- of entries and nothing can be computed.
dimensions {
  register {
    values ordered [ :colloquial, :neutral, :formal, :literary ]
    note   "competing 3-way and 5-way schemes exist; see mappings"
  }
}

lexemes {
  -- The regular case: the rule generates the plural, nothing is stipulated.
  kitāb {
    root     [ :k, :t, :b ]
    arab     :كِتَاب
    gloss    en "book"
    template -> @patterns.fiʿāl
    plural   derived-by -> @r-001
    agree    :fem.sg
    attest   { src "Wright II", conf 0.99 }
  }

  -- A residual: two plurals differing by register, which no rule derives.
  ṭālib {
    root     [ :ṭ, :l, :b ]
    arab     :طَالِب
    gloss    en "student"
    template -> @fāʿil
    -- NOTE: docs/08 and docs/09 write this as `plurals discriminated-by
    -- [ :register ] [ … ]`, which the grammar cannot express — annotations
    -- are bare words and take no arguments. The nested form below says the
    -- same thing and is arguably better modelling.
    plurals {
      discriminated-by [ :register ]
      rows [
        | form      via         register  freq
        | :طُلَّاب     -> @fuʿʿāl  :neutral  0.71
        | :طَلَبَة      -> @faʿala  :formal   0.28
  ]
    }
  }

  -- The plural selects the SENSE, not the other way round. Modelling this
  -- forced plurals onto senses rather than onto the lexeme.
  bayt {
    root  [ :b, :y, :t ]
    arab  :بَيْت
    weak  :hollow-y
    senses {
      dwelling { gloss en "house", plural :بُيُوت,  via -> @fuʿūl }
      verse    { gloss en "verse of poetry", plural :أَبْيَات, via -> @patterns.ʾafʿāl }
    }
  }
}

-- Negative facts. Rules overgenerate, so a positive-only knowledge base
-- silently becomes an overgenerating one.
blocked [
  | lexeme        form       reason
  | -> @lexemes.kitāb     :كِتْبَان    "derivable by r-002 but unattested"
  | -> @lexemes.ṭālib     :طَوَالِب    "blocked by the existing plurals above"
  ]

-- Completeness must be stated. Open-world is usually right for language
-- data, but leaving it implicit makes "the rule is wrong" indistinguishable
-- from "we have not looked yet".
coverage {
  world     :open
  lexemes   3
  estimated 15000
  note      "fragment only; see docs/09 for sizing"
}

The canonical encoding

Produced by the reference encoder when this page was built. Decoding these bytes and printing them in the text form returns the document above, byte for byte — that round trip is the claim the whole format rests on.

a7 64 75 73 65 73 a1 68 6c 69 6e 67 2f 69 70 61 da 00 01 11 d8 82 66 73
68 61 32 35 36 44 6c 82 f1 a9 65 72 75 6c 65 73 83 a5 62 69 64 da 00 01
11 d4 65 72 2d 30 30 31 66 70 6c 75 72 61 6c da 00 01 11 d7 6f 70 61 74
74 65 72 6e 73 2e 66 75 ca bf 75 6c 68 73 69 6e 67 75 6c 61 72 da 00 01
11 d7 70 70 61 74 74 65 72 6e 73 2e 66 69 ca bf c4 81 6c 6a 63 6f 6e 64
69 74 69 6f 6e 73 81 da 00 01 11 d4 6a 73 6f 75 6e 64 2d 72 6f 6f 74 6a
63 6f 6e 66 69 64 65 6e 63 65 c4 82 21 18 52 a5 62 69 64 da 00 01 11 d4
65 72 2d 30 30 32 66 70 6c 75 72 61 6c da 00 01 11 d7 72 70 61 74 74 65
72 6e 73 2e ca be 61 66 ca bf c4 81 6c 68 73 69 6e 67 75 6c 61 72 da 00
01 11 d7 66 66 61 ca bf 61 6c 6a 63 6f 6e 64 69 74 69 6f 6e 73 81 da 00
01 11 d4 6a 73 6f 75 6e 64 2d 72 6f 6f 74 6a 63 6f 6e 66 69 64 65 6e 63
65 c4 82 21 18 3d a5 62 69 64 da 00 01 11 d4 65 72 2d 30 30 33 66 70 6c
75 72 61 6c da 00 01 11 d7 69 66 75 ca bf ca bf c4 81 6c 68 73 69 6e 67
75 6c 61 72 da 00 01 11 d7 67 66 c4 81 ca bf 69 6c 6a 63 6f 6e 64 69 74
69 6f 6e 73 82 da 00 01 11 d4 65 68 75 6d 61 6e da 00 01 11 d4 68 61 67
65 6e 74 69 76 65 6a 63 6f 6e 66 69 64 65 6e 63 65 c4 82 21 18 4a 67 62
6c 6f 63 6b 65 64 82 a3 64 66 6f 72 6d da 00 01 11 d4 70 d9 83 d9 90 d8
aa d9 92 d8 a8 d9 8e d8 a7 d9 86 66 6c 65 78 65 6d 65 da 00 01 11 d7 6e
6c 65 78 65 6d 65 73 2e 6b 69 74 c4 81 62 66 72 65 61 73 6f 6e 78 21 64
65 72 69 76 61 62 6c 65 20 62 79 20 72 2d 30 30 32 20 62 75 74 20 75 6e
61 74 74 65 73 74 65 64 a3 64 66 6f 72 6d da 00 01 11 d4 70 d8 b7 d9 8e
d9 88 d9 8e d8 a7 d9 84 d9 90 d8 a8 66 6c 65 78 65 6d 65 da 00 01 11 d7
70 6c 65 78 65 6d 65 73 2e e1 b9 ad c4 81 6c 69 62 66 72 65 61 73 6f 6e
78 25 62 6c 6f 63 6b 65 64 20 62 79 20 74 68 65 20 65 78 69 73 74 69 6e
67 20 70 6c 75 72 61 6c 73 20 61 62 6f 76 65 67 6c 65 78 65 6d 65 73 a3
64 62 61 79 74 a4 64 61 72 61 62 da 00 01 11 d4 6a d8 a8 d9 8e d9 8a d9
92 d8 aa 64 72 6f 6f 74 83 da 00 01 11 d4 61 62 da 00 01 11 d4 61 79 da
00 01 11 d4 61 74 64 77 65 61 6b da 00 01 11 d4 68 68 6f 6c 6c 6f 77 2d
79 66 73 65 6e 73 65 73 a2 65 76 65 72 73 65 a3 63 76 69 61 da 00 01 11
d7 72 70 61 74 74 65 72 6e 73 2e ca be 61 66 ca bf c4 81 6c 65 67 6c 6f
73 73 da 00 01 11 d5 82 81 da 00 01 11 d4 62 65 6e 6f 76 65 72 73 65 20
6f 66 20 70 6f 65 74 72 79 66 70 6c 75 72 61 6c da 00 01 11 d4 70 d8 a3
d9 8e d8 a8 d9 92 d9 8a d9 8e d8 a7 d8 aa 68 64 77 65 6c 6c 69 6e 67 a3
63 76 69 61 da 00 01 11 d7 67 66 75 ca bf c5 ab 6c 65 67 6c 6f 73 73 da
00 01 11 d5 82 81 da 00 01 11 d4 62 65 6e 65 68 6f 75 73 65 66 70 6c 75
72 61 6c da 00 01 11 d4 6c d8 a8 d9 8f d9 8a d9 8f d9 88 d8 aa 66 6b 69
74 c4 81 62 a7 64 61 72 61 62 da 00 01 11 d4 6c d9 83 d9 90 d8 aa d9 8e
d8 a7 d8 a8 64 72 6f 6f 74 83 da 00 01 11 d4 61 6b da 00 01 11 d4 61 74
da 00 01 11 d4 61 62 65 61 67 72 65 65 da 00 01 11 d4 66 66 65 6d 2e 73
67 65 67 6c 6f 73 73 da 00 01 11 d5 82 81 da 00 01 11 d4 62 65 6e 64 62
6f 6f 6b 66 61 74 74 65 73 74 a2 63 73 72 63 69 57 72 69 67 68 74 20 49
49 64 63 6f 6e 66 c4 82 21 18 63 66 70 6c 75 72 61 6c da 00 01 11 d5 82
81 da 00 01 11 d4 6a 64 65 72 69 76 65 64 2d 62 79 da 00 01 11 d7 65 72
2d 30 30 31 68 74 65 6d 70 6c 61 74 65 da 00 01 11 d7 70 70 61 74 74 65
72 6e 73 2e 66 69 ca bf c4 81 6c 68 e1 b9 ad c4 81 6c 69 62 a5 64 61 72
61 62 da 00 01 11 d4 6c d8 b7 d9 8e d8 a7 d9 84 d9 90 d8 a8 64 72 6f 6f
74 83 da 00 01 11 d4 63 e1 b9 ad da 00 01 11 d4 61 6c da 00 01 11 d4 61
62 65 67 6c 6f 73 73 da 00 01 11 d5 82 81 da 00 01 11 d4 62 65 6e 67 73
74 75 64 65 6e 74 67 70 6c 75 72 61 6c 73 a2 64 72 6f 77 73 82 a4 63 76
69 61 da 00 01 11 d7 69 66 75 ca bf ca bf c4 81 6c 64 66 6f 72 6d da 00
01 11 d4 6e d8 b7 d9 8f d9 84 d9 8e d9 91 d8 a7 d8 a8 64 66 72 65 71 c4
82 21 18 47 68 72 65 67 69 73 74 65 72 da 00 01 11 d4 67 6e 65 75 74 72
61 6c a4 63 76 69 61 da 00 01 11 d7 67 66 61 ca bf 61 6c 61 64 66 6f 72
6d da 00 01 11 d4 6e d8 b7 d9 8e d9 84 d9 8e d8 a8 d9 8e d8 a9 64 66 72
65 71 c4 82 21 18 1c 68 72 65 67 69 73 74 65 72 da 00 01 11 d4 66 66 6f
72 6d 61 6c 70 64 69 73 63 72 69 6d 69 6e 61 74 65 64 2d 62 79 81 da 00
01 11 d4 68 72 65 67 69 73 74 65 72 68 74 65 6d 70 6c 61 74 65 da 00 01
11 d7 67 66 c4 81 ca bf 69 6c 68 63 6f 76 65 72 61 67 65 a4 64 6e 6f 74
65 78 25 66 72 61 67 6d 65 6e 74 20 6f 6e 6c 79 3b 20 73 65 65 20 64 6f
63 73 2f 30 39 20 66 6f 72 20 73 69 7a 69 6e 67 65 77 6f 72 6c 64 da 00
01 11 d4 64 6f 70 65 6e 67 6c 65 78 65 6d 65 73 03 69 65 73 74 69 6d 61
74 65 64 19 3a 98 68 70 61 74 74 65 72 6e 73 a4 66 66 75 ca bf 75 6c a6
64 61 72 61 62 da 00 01 11 d4 6a d9 81 d9 8f d8 b9 d9 8f d9 84 64 6b 69
6e 64 da 00 01 11 d4 66 62 72 6f 6b 65 6e 65 63 6c 61 73 73 da 00 01 11
d4 66 70 6c 75 72 61 6c 66 6e 75 6d 62 65 72 da 00 01 11 d4 69 6d 75 6c
74 69 74 75 64 65 68 73 6b 65 6c 65 74 6f 6e 85 da 00 01 11 d4 62 43 31
da 00 01 11 d4 61 55 da 00 01 11 d4 62 43 32 da 00 01 11 d4 61 55 da 00
01 11 d4 62 43 33 68 74 72 69 70 74 6f 74 65 f5 67 66 69 ca bf c4 81 6c
a3 64 61 72 61 62 da 00 01 11 d4 6c d9 81 d9 90 d8 b9 d9 8e d8 a7 d9 84
65 63 6c 61 73 73 da 00 01 11 d4 68 73 69 6e 67 75 6c 61 72 68 73 6b 65
6c 65 74 6f 6e 85 da 00 01 11 d4 62 43 31 da 00 01 11 d4 61 49 da 00 01
11 d4 62 43 32 da 00 01 11 d4 62 c4 80 da 00 01 11 d4 62 43 33 69 6d 61
66 c4 81 ca bf 69 6c a5 64 61 72 61 62 da 00 01 11 d4 70 d9 85 d9 8e d9
81 d9 8e d8 a7 d8 b9 d9 90 d9 84 64 6b 69 6e 64 da 00 01 11 d4 66 62 72
6f 6b 65 6e 64 73 74 65 6d da 00 01 11 d4 71 71 75 61 64 72 69 63 6f 6e
73 6f 6e 61 6e 74 61 6c 65 63 6c 61 73 73 da 00 01 11 d4 66 70 6c 75 72
61 6c 68 74 72 69 70 74 6f 74 65 f4 69 ca be 61 66 ca bf c4 81 6c a7 64
61 72 61 62 da 00 01 11 d4 70 d8 a3 d9 8e d9 81 d9 92 d8 b9 d9 8e d8 a7
d9 84 64 6b 69 6e 64 da 00 01 11 d4 66 62 72 6f 6b 65 6e 64 6e 6f 74 65
78 2d 70 61 75 63 69 74 79 20 73 65 6e 73 65 20 77 65 61 6b 6c 79 20 6f
62 73 65 72 76 65 64 20 69 6e 20 6d 6f 64 65 72 6e 20 75 73 61 67 65 65
63 6c 61 73 73 da 00 01 11 d4 66 70 6c 75 72 61 6c 66 6e 75 6d 62 65 72
da 00 01 11 d4 67 70 61 75 63 69 74 79 68 73 6b 65 6c 65 74 6f 6e 87 da
00 01 11 d4 62 ca be da 00 01 11 d4 61 41 da 00 01 11 d4 62 43 31 63 e2
88 85 da 00 01 11 d4 62 43 32 da 00 01 11 d4 62 c4 80 da 00 01 11 d4 62
43 33 68 74 72 69 70 74 6f 74 65 f5 6a 64 69 6d 65 6e 73 69 6f 6e 73 a1
68 72 65 67 69 73 74 65 72 a2 64 6e 6f 74 65 78 35 63 6f 6d 70 65 74 69
6e 67 20 33 2d 77 61 79 20 61 6e 64 20 35 2d 77 61 79 20 73 63 68 65 6d
65 73 20 65 78 69 73 74 3b 20 73 65 65 20 6d 61 70 70 69 6e 67 73 66 76
61 6c 75 65 73 da 00 01 11 d5 82 81 da 00 01 11 d4 67 6f 72 64 65 72 65
64 84 da 00 01 11 d4 6a 63 6f 6c 6c 6f 71 75 69 61 6c da 00 01 11 d4 67
6e 65 75 74 72 61 6c da 00 01 11 d4 66 66 6f 72 6d 61 6c da 00 01 11 d4
68 6c 69 74 65 72 61 72 79
canonical CBOR for examples/morphology.umsg 2217 bytes

Every construct on this page

The formal columns are read from the specification when this page is generated. The last column is this site's plain-language gloss and is not normative — where they differ, the specification is right.

constructglyphcarriesexamplegloss
:annotationA bare name qualifying the value after it—for example a language tag or a unit such as kg. It is not a value itself; a bare name with nothing after it is an error, not a guess.
:array^type, or type:shape; then [ elements ]^f64 [ 1.5, 2.5 ] or ^i16:2x3 [ … ]A packed, homogeneous numeric array. The ^ marker gives every element its type and may also give the row-major shape: ^f64:2x3 [ … ].
:array-elementOne element of a typed array. Its type comes from the ^ marker, so 1.5 inside ^f64 is binary64 rather than an exact decimal.
:array-missingA missing position in a typed array. null here is not an element value: it adds a validity mask while preserving the array's shape.
:blockA block: named pairs, in braces. Its keys are sorted in the encoding and shown here as written.
:bytes~encoding:data~hex:ff00 or ~b64:iVBORw0KGgo=Raw octets, carried as octets. No base64 tax, no pretending they are text.
:comment--to end of line-- a noteA note for people. It travels with the pair it precedes and never reaches the bytes.
:decimalAn exact decimal. 19.99 is nineteen and ninety-nine hundredths, not the nearest double to it.
:extension!name, then value!acme/hint { zone 4 }A qualifier this reader may not know. It survives the round trip intact, and stays legible on the way past — the rule that separates an extension from a private convention.
:floatA binary float, marked so it can never be mistaken for the exact decimal beside it.
:hash#algorithm:hex#sha256:deadbeefThe digest of some content, with the algorithm said out loud so it is still meaningful in ten years.
:header%unimsg only%unimsg 0 labelDeclares the format version and what this document is. Optional, and useful exactly when a file arrives without context.
:identifier@word@ord-88213Gives this value a name, so another document can point at it without copying it.
:integerA whole number of any size. Past 2^53 it is still exact, which is the whole reason this is not JSON.
:keyA field name: the first thing in a pair. It is bare when possible and quoted when needed, and names the content without becoming part of the value.
:reference->an identifier or a path-> @cust-4471, -> @lexicon.entries.kitābPoints at a name. Nothing follows it while reading — resolution is somebody else's job, deliberately.
:reserved-literalOne of six bare words that are values rather than names. The list is fixed, so no value is coerced by what it looks like.
:sequenceAn ordered list. Order is preserved and is meaning.
:stringText. May span lines, so prose does not have to be escaped into one.
:symbol:word:dispatchedA name from a fixed vocabulary, not free text. :high is a value someone chose; "high" is a phrase someone typed.
:table-row|cells| sku qtyOne record of a table. A table is sugar for a sequence of blocks with the same keys, and encodes identically to the longhand.
:timestampA temporal value at the precision written. 2026-08 stays a month, and 03:52 stays a wall-clock time; neither is widened into an invented instant.