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 asourceobject with provenance information (urlandlicense).
Go
- Entry point:
en.WordDatainen/schema.go. - API responses wrap the word data in
WrappedWordData[en.WordData](packagewrapper), which adds the samesourceobject. - Uses Go’s
json/v2package; compile withGOEXPERIMENT=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
| Type | Description |
|---|---|
WordData | Top-level word entry: word, language, part of speech, and all lexical data. |
SenseData | A single sense (numbered definition) with glosses, examples, lexical relations, and Wikidata/Wikipedia links. |
ExampleData | Example sentence with translations, romanizations, ruby annotations, and bold-span offsets. |
FormData / FormOf | Inflected / alternative surface forms and the lemmas they belong to. |
SoundData | Pronunciation data: IPA, audio files, rhymes, dialect tags, etc. |
TranslationData | Translation of a sense into another language. |
LinkageData | A lexical relation (synonym, antonym, hypernym, hyponym, derived term, etc.). |
DescendantData | Descendant word in another language, forming a recursive etymological tree. |
AttestationData / ReferenceData | Historical attestations with dates and bibliographic references. |
TemplateData | A Wikitext template invocation (head line, inflection tables, info boxes). |
Hyphenation / DeprecatedHyphenation | Syllable-level hyphenation, plus the legacy list[str] format. |
EtymologyExample | Example sentence appearing in an etymology section. |
AltOf | The target word a sense is an alternative form of. |
RubyData | Ruby (furigana) annotation for CJK characters. |
LinkData | A wiki-internal link tuple [target, gloss]. |
PlusObjTemplateData / ExtraTemplateData | Structured arguments of certain templates (e.g. {{compound+}}). |
StringOrInt / TemplateArgs | Template argument keys: positional indices (i64) or named parameters (String). |
WordData Fields
| Category | Fields |
|---|---|
| Identification | word, lang, lang_code, pos, original_title |
| Senses | senses |
| Forms & variants | forms, form_of, alt_of, instances |
| Pronunciation | sounds |
| Etymology | etymology_text, etymology_number, etymology_examples, descendants |
| Lexical relations | synonyms, antonyms, hypernyms, hyponyms, holonyms, meronyms, troponyms, coordinate_terms, derived, related, abbreviations, anagrams, proverbs |
| Translations | translations |
| Hyphenation | hyphenation (deprecated), hyphenations |
| Templates | head_templates, inflection_templates, info_templates |
| Links & metadata | categories, 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::WordDataand its dependencies on docs.rs. - Reference Python type definitions:
references/en.pyin the wiktionary-schema-rs repository.