Dataset Viewer

The dataset viewer is not available because its heuristics could not detect any supported data files. You can try uploading some data files, or configuring the data files location manually.

A Lean English Dictionary

A compressed, offline-ready English dictionary derived from the kaikki.org machine-readable extraction of Wiktionary. Packed into a single SQLite file (~53MB) so it can be bundled directly into an app instead of queried over a network.

Why this exists

I built this to power offline dictionary lookups in OpenLeaf, an Android e-reader app, tap a word while reading, get a definition, no network round-trip. OpenLeaf It's published here in case it's useful to anyone else building something similar.

Source & Attribution

This dataset is a derivative of Wiktionary content, extracted via kaikki.org's Wiktextract project. Per Wiktionary's copyright terms, the underlying text is available under CC BY-SA 4.0 / GFDL; this dataset is redistributed under CC BY-SA 4.0.

  • Original text: © Wiktionary contributors, https://en.wiktionary.org
  • Extraction: kaikki.org / Tatu Ylonen, https://kaikki.org
  • If citing academically, kaikki.org requests: Tatu Ylonen, "Wiktextract: Wiktionary as Machine-Readable Structured Data," LREC 2022.

What's different from the raw Wiktionary/kaikki.org data

This isn't a full mirror — it's a filtered, restructured subset built for size. Specifically:

  • Capped at 4 senses per word, prioritizing non-archaic/obsolete/rare definitions
  • Synonyms limited to a word's first 3 senses
  • Bare single-word "definitions" (e.g. a noun sense that's just one word) are dropped when a fuller sense already exists for that word
  • Example sentences filtered for length and cleanliness; the shortest valid example is kept per sense
  • Inflected and derived forms (plurals, past tense, etc.) are resolved via a pointer to their root word rather than duplicating definitions
  • Proper nouns and multi-word phrases (more than 2 words) are excluded
  • Every word's senses are compressed with zlib against a shared 32KB preset dictionary

If you need the complete, unfiltered dataset, kaikki.org's raw JSONL export is the better starting point.

File format

openLeaf-dictionary.db is a SQLite database, not plain text or JSON, so it won't render in the Hugging Face dataset viewer as-is.

Schema:

  • words (word TEXT PRIMARY KEY, ipa TEXT, points_to TEXT, meanings BLOB)meanings is a zlib-compressed (raw deflate, no header) JSON array of [pos_id, definition, example, synonyms] per sense.
  • meta (key TEXT PRIMARY KEY, value BLOB) — holds the shared 32KB preset dictionary under the key preset_dict, required to decompress any row.

POS ids: 1=noun 2=verb 3=adj 4=adv 5=pron 6=prep 7=conj 8=interj 9=phrase

If meanings decodes to an empty list and points_to is set, look up that word instead — it's an inflected or derived form pointing at its root.

Reading a row (Python)

import sqlite3, zlib, json

conn = sqlite3.connect("openLeaf-dictionary.db")
preset_dict = conn.execute(
    "SELECT value FROM meta WHERE key = ?", ("preset_dict",)
).fetchone()[0]

word, ipa, points_to, blob = conn.execute(
    "SELECT word, ipa, points_to, meanings FROM words WHERE word = ? COLLATE NOCASE",
    ("run",)
).fetchone()

d = zlib.decompressobj(-15, zdict=preset_dict)
senses = json.loads(d.decompress(blob) + d.flush())

Reading a row (Android / Kotlin)

In Android, use java.util.zip.Inflater configured for raw deflate (nowrap = true). You must apply the dictionary preset before the first inflation occurs.

fun decompressSenses(blob: ByteArray, presetDict: ByteArray): String {
    val inflater = java.util.zip.Inflater(true) // true = nowrap
    inflater.setDictionary(presetDict)
    inflater.setInput(blob)

    val out = ByteArrayOutputStream(blob.size * 4)
    val buffer = ByteArray(4096)
    while (!inflater.finished()) {
        val n = inflater.inflate(buffer)
        if (n == 0 && inflater.needsInput()) break
        out.write(buffer, 0, n)
    }
    inflater.end()
    return out.toString("UTF-8")
}

Because inflected and derived forms carry no senses of their own, remember to check the points_to column if the decoded JSON array is empty. If it is, perform a single recursive lookup to the root word:

val senses = JSONArray(decompressedString)

if (senses.length() == 0 && pointsTo != null) {
    // This is an inflected form. Look up the word in `pointsTo` instead.
}

Known limitations

  • No translations, etymologies, or pronunciation audio
  • Sense caps mean less-common meanings of highly polysemous words may be missing
  • Pointer resolution only follows one hop — a word pointing to another pointer won't resolve further

License

Released under CC BY-SA 4.0, consistent with Wiktionary's own licensing. If you redistribute or build on this dataset, you must attribute Wiktionary and kaikki.org, note any changes you make, and license your derivative under CC BY-SA 4.0 or a compatible license.

Author

Built and maintained by BlazingCerulean.

Downloads last month
61