--- language: - he license: cc-by-nc-4.0 pretty_name: Dicta Unvocalized Hebrew Wordlist size_categories: - 1M e.g. "VERB"; same for binyan, gender, tense, ... ``` ## Columns | column | type | notes | |---|---|---| | `id` | int | per-row id | | `lemma_id` | int | one per unique vocalized `lex` (rows sharing a lemma share it) | | `word` | string | the word's most common full spelling, with matres lectionis (maleh). Not unique — rows can share a `word` with different lemma/morphology | | `haser` | string? | defective (haser) spelling — without matres lectionis — if distinct | | `maleh_forms` | list[string] | additional maleh spellings (with matres lectionis) believed to be in use, if any | | `lex` | string | vocalized lemma (dictionary form) | | `lex_maleh` | string | unvocalized maleh spelling of the lemma | | `root` | string? | consonantal root | | `pos` | ClassLabel | part of speech | | `binyan` | ClassLabel | verb stem | | `gender`, `number`, `person`, `tense`, `status` | ClassLabel | inflectional morphology | | `suffix_function`, `suffix_gender`, `suffix_number`, `suffix_person` | ClassLabel | pronominal suffix, null if none | | `shortened_form`, `inversive_vav`, `extended_form`, `poetry`, `aramaic`, `pre_modern_form`, `loazi_word`, `passive`, `tanakh` | bool | linguistic flags | Categorical columns are `ClassLabel`: the Parquet stores integer codes and the label names live in the file's feature metadata (recovered automatically by `datasets`). ### Label glossary (non-obvious values) - `pos`: `SHEL_PREP` = של and inflections thereof; `AT_PREP` = את and inflections thereof; `TITULAR` = title (e.g. ר', מר). - `person` / `suffix_person`: `ANY` = unspecified person. - `gender`: `MASCULINEFEMININE` = either. - `status`: `ABSOLUTECONSTRUCT` = form valid as both absolute and construct. - `suffix_function`: `POSSESIVEPRONOUN` (possessive) vs `ACCUSATIVENOMINATIVE` (object/subject clitic). Note: tagging of function words that carry suffixes is inconsistent. ## Attested wordforms (`attested` config) Where the `default` config lists every *theoretically valid* word-object Dicta knows, the `attested` config lists wordform+morphologies believed by Dicta to actually exist in the wild with some frequency. Each row is a distinct `(wordform, prefix, morphology)` seen or tagged in at least one corpus, across five genres. ```python from datasets import load_dataset ds = load_dataset("dicta-il/wordlist", "attested", split="train") ds.features["pos"].int2str(ds[0]["pos"]) # same for binyan, gender, etc. ds.features["genres"].feature.int2str(ds[0]["genres"]) # genres is a list of ClassLabels ``` | column | type | notes | |---|---|---| | `wordform` | string | the attested unvocalized spelling, with the prefix removed | | `prefix` | string | the attached prefix letters (empty if none) | | `pos` | ClassLabel | part of speech — includes `INITIALISM`, which the `default` table does not | | `binyan`, `gender`, `number`, `person`, `tense`, `status` | ClassLabel | inflectional morphology | | `suffix_function`, `suffix_gender`, `suffix_number`, `suffix_person` | ClassLabel | pronominal suffix, null if none | | `genres` | list[ClassLabel] | genres the form was attested in: Modern, Rabbinic, Talmud, ModernPoetry, MedievalPoetry | Notes: - No lemma/haser/maleh columns: those are word-object facts, not observations. To recover them, join back to the `default` config — but note a `wordform` is any *spelling* of a word-object, so it may appear in the `default` config's `word`, `haser`, **or** `maleh_forms`. Match against all three (e.g. `wordform IN (word, haser)` or `wordform` a member of `maleh_forms`), plus morphology. - `wordform` is ~99% a subset of the `default` table's known spellings (`word`/`haser`/`maleh_forms`); the residual is mostly out-of-wordlist POS (e.g. `INITIALISM`), some classes that are too productive to capture in a list (Internet-style spellings, names of years, etc.), and a few of what appear to be tagging errors. ## Prefix-aware lookup (helper script) The wordlist has **no prefixes** — every row is a bare word. Hebrew, though, attaches prefix letters (ו, ה, ש, ב, כ, ל, מ, and clusters like כש, וה) directly onto a word. To look up a surface form that may carry a prefix, this repo ships a helper that splits the form into a prefix + a wordlist row, keeps only prefixes *grammatically allowed* to attach to that row (e.g. the definite article ה attaches to an adjective but not to a past-tense verb), and **ranks** the readings by likelihood. Two files drive it: `wordlist_query.py` (the logic) and `prefix-table.json` (valid prefixes, their grammatical functions, and per-genre rarity). Fetch and import them from the repo — `load_dataset` alone won't run the script: ```python from huggingface_hub import hf_hub_download import importlib.util path = hf_hub_download("dicta-il/wordlist", "wordlist_query.py", repo_type="dataset") spec = importlib.util.spec_from_file_location("wq", path) wq = importlib.util.module_from_spec(spec); spec.loader.exec_module(wq) q = wq.WordlistQuery(genre="Modern") # see the cost note below; prints progress (verbose=False to mute) for m in q.get_word_options("הגדול"): # "the big (one)" — ranked, most likely first print(m.prefix, m.function, m.row["word"], m.row["lex"], m.row["pos"], m.morph_anchor) # top result: ה {'def': True, ...} גדול גָּדוֹל ADJECTIVE True # the ה-interrogative reading of the same word, and verb readings, rank below it ``` **Cost & reuse:** the first `WordlistQuery(...)` downloads the two parquets once (cached by `huggingface_hub`) and builds an in-memory index over the ~4M-row `default` config. This one-time build will likely take **a few minutes and a couple of GB of RAM**. Queries afterward are instant. The rows stay in the memory-mapped Arrow table and are materialized on demand, so **build one `WordlistQuery` and reuse it** for the life of the process rather than reconstructing it per query. **Memory modes.** The default holds the index in memory for instant queries. For less RAM, pass `WordlistQuery(low_memory=True)` to skip that build and scan the memory-mapped data per query instead — resident RAM stays near the mmap baseline (tens of MB) and startup is near-instant, at about ~1s per query; good for a long-running GUI or a memory-constrained machine. Or pass `WordlistQuery(disk=True)` for the middle ground: a one-time build of a persistent indexed file (~500 MB, written to `wordlist-index.duckdb` in the working directory — pass `disk="/path/to/index.duckdb"` to place it elsewhere), then fast index-seek queries (~tens of ms) at that same low footprint. The file is rebuilt automatically when a new release changes the data; note the one-time build peaks above the steady-state footprint (it is not itself a low-memory operation). Call `.close()` to release the file handle when done (needed on Windows before an in-process rebuild). Each result is a `Match(prefix, wordform, function, row, morph_anchor, spelling, anchor_genres)`: - `prefix` — the attached prefix letters (`""` if none). - `wordform` — the queried spelling that matched (may be the row's `word`, `haser`, or a `maleh_forms` member). - `function` — the *single* prefix function this reading uses (`None` when there's no prefix). One result is emitted per prefix function, so ה-definite and ה-interrogative are ranked separately. - `row` — the matched `default`-config row as a dict: every scalar column (`id`, `lemma_id`, `word`, `haser`, `maleh_forms`, `lex`, `lex_maleh`, `root`, and all the linguistic flags — `tanakh`, `inversive_vav`, `poetry`, `aramaic`, `pre_modern_form`, `shortened_form`, `extended_form`, `loazi_word`, `passive`) plus `morph` (the categorical morphology as a named tuple). `row["id"]` is the key back into the `default` config for anything you need to re-derive. - `morph_anchor` — whether this exact morphology was **attested** for `(wordform, prefix)` in the target genre (from the `attested` config). This is the strongest ranking signal. - `spelling` — a `Spelling` enum saying which column of the `default` table the `wordform` came from, i.e. how expected this unvocalized spelling is for that morphology: `real_maleh` (the primary `word`), `haser` (the defective spelling), or `alt_maleh` (an alternate `maleh_forms` spelling). Anything other than `real_maleh` indicates that it's generally an unlikely spelling to find in unvocalized modern text. - `anchor_genres` — the set of **all** genres this `(wordform, prefix, morphology)` was attested in (Modern / Rabbinic / Talmud / ModernPoetry / MedievalPoetry). `morph_anchor` is just whether the query `genre` is in this set; the set shows the full cross-genre picture (e.g. a form attested only in Talmud reads `{Talmud}` and is not a Modern anchor). Requires only `datasets` + `huggingface_hub`. Results are ordered by a priority hierarchy: attested morphology first, then non-interrogative readings, non-poetry, non-pre-modern, non-Tanakh-only (proper names excepted), maleh spelling over haser, and common over rare verb/prefix forms. ## Maintainers: label stability (read before updating) Categorical columns are `ClassLabel`, and each integer code is the **position** of its name in the label list. When regenerating or extending this dataset — **by any means** — you must **only append new label values at the end**. Never reorder or insert: doing so silently remaps existing codes and breaks every consumer that compares against integers across versions. (This is why the `attested` config's `pos` has `INITIALISM` appended at index 20, after the `default` config's 20 values.) See `CHANGELOG.md` for version history.