Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Wiktionary Schema - English Edition

The English edition is implemented in both Rust and Go.

Rust

  • Entry point: en::WordData — a single word entry from the English Wiktionary data dump.
  • API responses wrap the word data in en::WrappedWordData, which adds a source object with provenance information (url and license).

Go

  • Entry point: en.WordData in en/schema.go.
  • API responses wrap the word data in WrappedWordData[en.WordData] (package wrapper), which adds the same source object.
  • Uses Go’s json/v2 package; compile with GOEXPERIMENT=jsonv2.

Data Model

The schema mirrors the Python TypedDict definitions used by wiktextract for the English edition, kept in references/en.py in the repository. The top-level type WordData represents a single word entry: each JSONL line of the wiktextract dump deserializes into one instance.

All fields are optional (Option<T> in Rust, pointers in Go) except the identification fields (word, lang, lang_code) and a few core fields such as LinkageData::word. Fields deprecated upstream in wiktextract are annotated with #[deprecated] (e.g. english → translation, hyphenation → hyphenations).

Main Types

TypeDescription
WordDataTop-level word entry: word, language, part of speech, and all lexical data.
SenseDataA single sense (numbered definition) with glosses, examples, lexical relations, and Wikidata/Wikipedia links.
ExampleDataExample sentence with translations, romanizations, ruby annotations, and bold-span offsets.
FormData / FormOfInflected / alternative surface forms and the lemmas they belong to.
SoundDataPronunciation data: IPA, audio files, rhymes, dialect tags, etc.
TranslationDataTranslation of a sense into another language.
LinkageDataA lexical relation (synonym, antonym, hypernym, hyponym, derived term, etc.).
DescendantDataDescendant word in another language, forming a recursive etymological tree.
AttestationData / ReferenceDataHistorical attestations with dates and bibliographic references.
TemplateDataA Wikitext template invocation (head line, inflection tables, info boxes).
Hyphenation / DeprecatedHyphenationSyllable-level hyphenation, plus the legacy list[str] format.
EtymologyExampleExample sentence appearing in an etymology section.
AltOfThe target word a sense is an alternative form of.
RubyDataRuby (furigana) annotation for CJK characters.
LinkDataA wiki-internal link tuple [target, gloss].
PlusObjTemplateData / ExtraTemplateDataStructured arguments of certain templates (e.g. {{compound+}}).
StringOrInt / TemplateArgsTemplate argument keys: positional indices (i64) or named parameters (String).

WordData Fields

CategoryFields
Identificationword, lang, lang_code, pos, original_title
Sensessenses
Forms & variantsforms, form_of, alt_of, instances
Pronunciationsounds
Etymologyetymology_text, etymology_number, etymology_examples, descendants
Lexical relationssynonyms, antonyms, hypernyms, hyponyms, holonyms, meronyms, troponyms, coordinate_terms, derived, related, abbreviations, anagrams, proverbs
Translationstranslations
Hyphenationhyphenation (deprecated), hyphenations
Templateshead_templates, inflection_templates, info_templates
Links & metadatacategories, wikidata, wikipedia, redirects, literal_meaning

Example

A minimal wrapped entry as returned by the API:

{
  "word": "hello",
  "lang": "English",
  "lang_code": "en",
  "pos": "intj",
  "senses": [
    {
      "glosses": ["A greeting (hello!)"]
    }
  ],
  "sounds": [
    {
      "ipa": "/həˈloʊ/"
    }
  ],
  "source": {
    "url": "https://en.wiktionary.org/wiki/hello",
    "license": {
      "name": "CC BY-SA 4.0",
      "url": "https://creativecommons.org/licenses/by-sa/4.0/"
    }
  }
}

Reference

  • Field-level documentation: en::WordData and its dependencies on docs.rs.
  • Reference Python type definitions: references/en.py in the wiktionary-schema-rs repository.