Mova0.6 pre-release

macula

MACULA Hebrew lowfat syntax trees of the Hebrew Bible into dependency trees, in CoNLL-U, as Ancient Hebrew (hbo) and Biblical Aramaic (arc); the Targums as text layers and a verse-aligned index in three languages.

Source. MACULA Hebrew Linguistic Datasets, available at github.com/Clear-Bible/macula-hebrew. © Biblica, Inc., CC BY 4.0. The syntax is the Westminster Hebrew Syntax of the J. Alan Groves Center (CC BY 4.0). The text and morphology come from the Open Scriptures Hebrew Bible (CC BY 4.0). The fields from the Semantic Dictionary of Biblical Hebrew (sdbh, lexdomain, coredomain, contextualdomain) are left out.

How it works

MACULA gives each sentence as word groups: clauses, with the roles of their parts (s, v, o, o2, io, pp, adv, p), and noun, preposition, number and adjective phrases, relative clauses and coordinations. The tool reads a dependency tree off them by head rules that follow the UD conventions for Hebrew and the readings of UD Ancient Hebrew PTNK:

A group with no rule for its head takes its first child.

Words are MACULA's: prefixes (ו, ה, ב, ל …) and suffix pronouns are words of their own, and a written word of more than one is a multiword token (as in PTNK); the article swallowed by a preposition (בַּ = בְּ + הַ) is written ה. A name MACULA keeps as one word with a space (בְּאֵר שָׁבַע) is a word per part, flat:name. The paseq ׀, sof pasuq ׃ and the paragraph marks ס, פ are PUNCT tokens. FORM and LEMMA are in NFC. FEATS holds gender, number, person, PronType and the verb stem (HebBinyan, letters only). MISC holds the English gloss, the word reference, Strong's number and MACULA's argument frame (Frame=A0:…;A1:…, who does what), where it has one, and Lang=arc on the Aramaic words. The files are made to pass the UD validator at level 2 (--lang hbo; the Aramaic with --lang arc); level 3 is not met (mostly advmod on a word that is no ADV).

Every tree is checked before it is written: one head per word, one root, no cycle (a negative control in the tests shows red). Two runs give the same files byte for byte.

Run

macula <lowfat-dir> <out-dir> [BOOK,…]

It writes <out-dir>/<BOOK>.conllu, with # sent_id = wlc:<BOOK>:<n> (one document per book) and # verse = GEN.1.1. It also writes <out-dir>/verses.tsv, which maps ids to verses. school-sents usfm gives English translations the same verse map, so the two line up verse by verse.

The Aramaic sentences go apart, to <out-dir>/arc/<BOOK>.conllu (# sent_id = wlc-arc:<BOOK>:<n>) and arc/verses.tsv. A sentence goes by the language of most of its words (MACULA's lang="A").

Words are written in the order of the text. MACULA gives them in the order of its groups, which sometimes takes a word from further on (Ruth 1:1: «וַיֵּלֶךְ אִישׁ מִבֵּית לֶחֶם», אִישׁ in the subject group after the place). The heads are read in MACULA's order, then the words are sorted by their id and the heads renumbered. Comparisons with PTNK match words by id, so the order does not affect them.

tools/hbo trains Mova's own parser for raw Hebrew on these trees.

Biblical Aramaic

MACULA marks every word with its language (lang="H" or "A"). The Aramaic words are Daniel 2:4b–7:28, Ezra 4:8–6:18 and 7:12–26, Jeremiah 10:11 and two words of Genesis 31:47. A sentence most of whose words are Aramaic goes to <out-dir>/arc/ (UD code arc), as above. Only two sentences mix the languages: Daniel 2:4 (the Hebrew frame «and the Chaldeans spoke to the king in Aramaic», then their words) goes to Aramaic, Genesis 31:47 (the name יְגַר שָׂהֲדוּתָא) stays Hebrew. Every Aramaic word has Lang=arc in MISC (in either folder), and a Hebrew word in an Aramaic sentence Lang=hbo.

The Aramaic trees use the same head rules, FEATS and MISC as the Hebrew ones; the stem is in HebBinyan too (PEAL, PAEL, HAPHEL, HITHPEEL …). Three lists have Aramaic members, used only for Aramaic words: the copula הֲוָה, the demonstratives דְּנָה, דָּא, אִלֵּין, דֵּךְ, אִלֵּךְ, דִּכֵּן (det), and the subordinator הֵן «if». The rest (verbs of saying אמר, ענה) share their consonants with Hebrew.

Limits: there is no Aramaic treebank to measure against, so the Aramaic trees are unmeasured. MACULA's English glosses in the Aramaic chapters are shifted by one word around the emphatic article (the noun «the», the article «king»), and are carried as they are. The emphatic ending א is a word of its own (DET, det), as MACULA splits it.

The whole Tanakh

macula <WLC lowfat> <out> converts all 39 books; the corpus keeps <out> as text/tanakh-wlc-macula and <out>/arc as text/tanakh-arc-macula (Aramaic in DAN, EZR and JER).

The Targums and the three-language index

macula targums <sefaria Tanakh/Targum dir> <text-dir>
macula tanakh3 <text-dir> <en-pool.tsv> <out-dir>

targums copies the Targums from Sefaria's export as text layers, verse by verse (BOOK.C.V → text, markup off, NFC): Targum Onkelos (the Torah, the toratemetfreeware edition), Targum Jonathan (the Prophets, Mikraot Gedolot) and the later Targums of the Writings (Psalms, Proverbs, Job, the Song, Ruth, Lamentations, Ecclesiastes, Esther from Mikraot Gedolot; Chronicles from Wikisource). Only an edition whose licence is «Public Domain» is copied; any other is refused (a test shows red on CC BY-SA and NC). Each layer has a SOURCES.tsv.

tanakh3 writes one TSV per book, a row per verse in the Hebrew numbering: the verse, the Hebrew sentence ids, the Aramaic (Biblical Aramaic sentence ids, and the Targum verse as onkelos:, jonathan: or targum:BOOK.C.V) and the English sentence ids (the pool's .verses). A sentence that spans verses is listed at each.

The Writings' Aramaic is missing where there is no Targum (Daniel's Hebrew chapters, Ezra, Nehemiah); the verses of Daniel and Ezra in Aramaic have the Aramaic and no Hebrew. A few verses have no English sentence of their own: JPS joins them to the verse before inside one sentence (Psalm titles, Numbers 26:1).

The English follows the Hebrew numbering: eBible's JPS 1917 gives JPS's own (Hebrew) numbers in brackets where they differ from the English ones, and school-sents usfm … --hebrew-verses maps each sentence to the Hebrew verse it begins in (the marks are taken off before the cut, so the ids are the same with and without the flag). In the Ten Commandments (Exodus 20, Deuteronomy 5) JPS counts by the upper accents and the Westminster Leningrad Codex by the lower ones, as the English does, so there the English numbering stays.

There is no Aramaic parser: the Targums are text only, without trees.

Comparing with UD PTNK

UD Ancient Hebrew PTNK (UD 2.18) is CC BY-NC, so it serves only as a measure. Its words carry MACULA ids, so they line up word for word (macula compare). LAS is counted on the relation without its subtype, and lemmas compare by their consonants, since the order of points differs between sources. The rules are decided on train and dev; the test split is read once per change of the rules.

The head rules were made on the Torah. Where the trees still differ from PTNK, it is mostly a choice of analysis: gapping is not read (PTNK orphan), a second accusative of material («overlay it with gold») is obl where PTNK has xcomp, and many head differences are where PTNK's sentences and MACULA's differ (a word is the root in one and a conj or parataxis in the other).

The dictionaries

The English dictionaries of the words of these trees (the Hebrew Bible, Biblical Aramaic, Targum Onkelos; Brown–Driver–Briggs 1906, the OpenScriptures lexical index, Jastrow 1903) are built by the Elamur Dictionary's builder, a closed tool. macula keeps the readers it shares with it, in src/lib.rs: unescape, html_text (the text of an entry's HTML), english_verses, hebrew_verses, verse_key and BOOKS. The Elamur Dictionary's site writes the dictionaries' pages from their tables.

Pragmatics

macula prag reads each Hebrew sentence into the columns of the parse database's prag.tsv: form, act, indirect, hedge, polarity, voice. It does this by rules on MACULA's words: the verb type in MISC Type= (wayyiqtol, imperative, jussive, cohortative, yiqtol, weqatal, …), person in FEATS, interrogatives, negatives and נָא. The code is in src/prag.rs. The rules read words only (multiword tokens and PUNCT are left out).

macula prag <trees-dir> <out.tsv> [--with rule,…] [--without rule,…]
macula prag-compare <out.tsv> <trees-dir>/verses.tsv <en prag.tsv> <en pool.tsv.verses>
macula prag-quotes <en pool.tsv>

The rules are also a library call, macula::prag::read_sentence(rows, open_before, &Rules), which roundtrip mixed uses on the trees of the Hebrew parser.

prag adds four columns after teacher:

prag-quotes prints the JPS quote state of each English sentence, so the speech measure can be checked by eye.

How it works

  1. The sentence is cut into frame and quote.
    • לֵאמֹר opens a quote whatever verb comes before it, and everything after it is the quote. If only its own words follow («לֵאמֹר לוֹ»), the quote is in the next sentence. On the current trees לֵאמֹר is not taken for a quote of its own verb.
    • Otherwise the ccomp our trees hang on a verb of saying (אמר, דבר, צוה, ענה, שאל, קרא) is the quote, together with the later clauses on that verb.
    • A narrator's wayyiqtol in the third person ends the quote: «וַיְהִי אוֹר», and there was light.
    • קָרָא with שֵׁם as its object names something. It does not speak.
    • In a multi-verb frame (וַיַּעַן … וַיֹּאמֶר) the later verb takes the quote.
  2. The quote is read as a character's speech, and the frame as narration. The row follows the English convention: a sentence that holds a quote takes the quote's form and act and voice «character». The frame's reading is kept in frame.
  3. Speech is carried from sentence to sentence within a book.
    • A frame that ends a verse («And the LORD spoke unto Moses, saying:») and a quote that reaches the end of its verse both leave a quote open.
    • The next sentence goes on in it (cont) until a narrator takes the story up again. That is a wayyiqtol in the third person with no first or second person in its clause, or a qatal with no mark of speech in the sentence.
  4. The speech is read.
    • An imperative, jussive or cohortative, or an infinitive absolute heading the clause, gives form imp and act request.
    • A yiqtol or weqatal in the second person («thou shalt (not) …») gives act request with indirect 1.
    • A question word (מִי, מָה, אֵיךְ, …) gives form wh, and interrogative הֲ gives q. A question takes act ask unless its first clause is a volitive.
    • A yiqtol or weqatal in the first person gives promise.
    • The form is the first clause's. The act is that of any clause.
    • נָא gives hedge 1.
    • Narration is decl, with act narrate for a wayyiqtol and assert otherwise.
  5. Polarity is left none. The English scheme's polarity is the speaker's evaluation (context), not negation. Negation has its own column.

Rules

Each rule can be left out (--without) or put in (--with); the defaults are prag::RULES minus prag::OFF.

rulewhat it doesdefault
ccompthe ccomp of a verb of saying is the quoteon
carryquotes go on into the next sentenceson
lemorלֵאמֹר opens a quote after any verbon
close-qatala qatal with no mark of speech closes a quoteon
promisefirst-person yiqtol/weqatal in speech is a promise (commissive)on
first-formthe form is the first clause'son
infabsan infinitive absolute heading a clause commandson
ask-firsta question asks even with a second-person verbon
amarafter a finite אמר, what follows its arguments is the quote, or the next sentence isoff
inner-framea frame inside open speech, or in the 1st/2nd person, is the character'soff
proposea plural cohortative, or a jussive with נָא, suggestsoff
resolvea singular cohortative is the speaker's resolve (promise)off
rhetoricalהֲלֹא assertsoff
close-offlineany unmarked clause that is not yiqtol/weqatal/volitive closes a quoteoff
law3a third-person yiqtol/weqatal in carried law prescribesoff
neg-polaritya negation makes polarity «neg»off
evaluatewords that judge (טוב, ברך … / רע, ארר, חטא …) give polarity, negation flips itoff

What prag-compare reports

prag-compare lines up the verses that are one Hebrew sentence with the English reading of the same verses, which a teacher gave JPS 1917 sentence by sentence in the parse database. It gives:

Sources

These were read, from the Scientist's library, and this is what each gave.

Limits

Torah lessons

macula lessons requests <trees-dir> <en-pool.tsv> <parashot.tsv> <work-dir>
macula lessons post <work-dir> <trees-dir> <en-pool.tsv> <school-dir>

The Torah course of the Judaism school: one lesson per weekly portion (parashah, 54), written by a teacher model from the portion's whole English text (JPS 1917, aliyot marked). requests writes one request per portion to <work-dir>/batch-requests.jsonl; the model is MOVA_TEACHER_MODEL, else MACULA_MODEL, else the shared mova-teacher default, at medium effort. The teacher also names three key verses and the tradition's reading of each. post reads <work-dir>/batch-results.jsonl and writes each lesson to <school-dir>/torah/NNN-<parashah>.lesson, with each key verse as a fact in layers taken from the texts, not from the teacher: the Hebrew verse (MACULA), word for word (its glosses), the JPS 1917 verse and the idea. Lessons that fail the checks are reported and not written. Marking the lessons for the pupils' dictionary is done by a closed tool.

Limits

This page in Markdown https://md.mova.elamur.ai/free/en/docs/tools/macula/