Language library format
A Language Library (libraries/<lang>/) defines reusable, language-level knowledge—canonical lexical Concepts, communicative expressions, and Universal Dependencies–matched grammatical Skills—independent of any course’s teaching order or learner first language (L1).
Courses reference a library via uses_library: <lang>@^1.0 in course.yaml.
Directory layout
Section titled “Directory layout”libraries/en/├── library.yaml # Required manifest: language, SemVer version, analyzer├── expressions.yaml # Communicative expressions (or expressions/*.yaml)├── lexicon/ # Lexical Concept Sets (sharded, e.g. a.yaml–z.yaml)│ ├── _providers.yaml # Provider sets constraining Skill template slots│ ├── a.yaml│ └── ...└── skills/ # Grammatical Skill Concept Sets (by skill type) ├── clause_linking.yaml ├── construction.yaml ├── function_words.yaml ├── morphology.yaml ├── syntax.yaml └── word_order.yamlOpenL2 discovers concept shards deterministically in this order:
skills/*.yamllexicon/*.yaml(and/or top-levellexicon.yaml)expressions.yaml(and/orexpressions/*.yaml)
Every Concept id and every alias must be unique across all shards in the library.
library.yaml
Section titled “library.yaml”language: deversion: 1.0.0description: Shared German concept library (skills, lexicon, and communicative expressions).analyzer: provider: stanza model: deKey fields:
language: Lowercase BCP 47 language tag (e.g.,en,de,es-mx,zh-cn; see Language codes). Must match the directory name.version: Strict SemVer (MAJOR.MINOR.PATCH). Courses pin compatible ranges viauses_library(^1.0,>=1.2.0,==1.0.0).analyzer: Linguistic analyzer configuration (providerand languagemodel) used for deterministic UD parsing and Skill pattern matching.description: Optional human-readable summary.
Concept shards (skills/, lexicon/, expressions.yaml)
Section titled “Concept shards (skills/, lexicon/, expressions.yaml)”Every shard is a YAML mapping containing concept_sets:
concept_sets: - name: Mid-position adverbs kind: skill skill: type: word_order name: Mid-position adverbs description: Put a mid-position adverb before a lexical main verb. Frequency adverbs follow finite main-verb be. concepts: - id: frequency-before-main-verb text: Subject Adverb before a main verb Main verb after a mid-position adverb sense: place a frequency or focusing adverb between the subject and its main verb pattern: predicate -[advmod]-> adverb; predicate -[nsubj]-> subject; subject << adverb; adverb << predicate subject: <NOUN|PROPN|PRON> adverb: always/usually/often/sometimes/never/also predicate: <VERB>Library-specific rules & metadata
Section titled “Library-specific rules & metadata”- Stable
idrequired: Every Concept in a shared library must declare a stableidso cross-course references and(language, concept_key)learner state remain durable across edits. - Study-language
sense: Senses onlexicalandcommunicative_expressionConcepts are written in the study language, never translated into an L1, so the library works for learners from any background. aliases: Optional list of legacy or alternate IDs that resolve to the same canonical Concept without breaking existing courses.idiomatic/frequency_rank: Optional library metadata preserved for difficulty analysis and corpus ranking.
UD pattern & role constraints
Section titled “UD pattern & role constraints”Skill Concepts can attach deterministic Universal Dependencies matching rules:
- Dependency edges:
head -[deprel]-> dependent(e.g.,noun -[amod]-> adjective,predicate -[nsubj]-> subject) - Linear order:
left << right(tokenleftprecedesrightin surface order) - Alternatives:
pattern: { any_of: [ ... ] }when a grammatical Skill has multiple valid syntactic realizations - Role constraints: Named roles constrain POS tags, morphological features (
<VERB, VerbForm=Fin, Tense=Pres>), closed word lists (am/is/are), or provider sets.
Provider sets (lexicon/_providers.yaml)
Section titled “Provider sets (lexicon/_providers.yaml)”Provider sets group canonical Concept references (concept:<id>) into semantic or grammatical classes that constrain <slot> fillers in Skill patterns:
concept_sets: - name: PlaceNoun kind: lexical concepts: - concept:cafe - concept:office - name: FrequencyAdverb kind: lexical concepts: - concept:oftenWhen a Skill rule constrains a <place> slot to PlaceNoun, cafe and office satisfy the rule while non-place nouns (like book) are rejected.
See also
Section titled “See also”- Concepts, Skills, and annotations — Shared Concept kinds, Skill types, and annotation syntax.
- Course format — How courses reference a library via
uses_libraryand layer onlocal_concepts.yaml.