Skip to content

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.

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.yaml

OpenL2 discovers concept shards deterministically in this order:

  1. skills/*.yaml
  2. lexicon/*.yaml (and/or top-level lexicon.yaml)
  3. expressions.yaml (and/or expressions/*.yaml)

Every Concept id and every alias must be unique across all shards in the library.

language: de
version: 1.0.0
description: Shared German concept library (skills, lexicon, and communicative expressions).
analyzer:
provider: stanza
model: de

Key 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 via uses_library (^1.0, >=1.2.0, ==1.0.0).
  • analyzer: Linguistic analyzer configuration (provider and language model) 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>
  • Stable id required: Every Concept in a shared library must declare a stable id so cross-course references and (language, concept_key) learner state remain durable across edits.
  • Study-language sense: Senses on lexical and communicative_expression Concepts 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.

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 (token left precedes right in 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 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:often

When a Skill rule constrains a <place> slot to PlaceNoun, cafe and office satisfy the rule while non-place nouns (like book) are rejected.