Published

October 21, 2024

Filter BDB articles using the part of speech designation from Strong

Let’s start with BDB plus Strong data for a token:

using BrownDriverBriggs 
plusentries = bdbplus("בָּרָ֣א")
6-element Vector{BDBplus}:
 בַּר (BDB01437) plus 4 Strong entries
 בַּר² (BDB01438) plus 4 Strong entries
 בָּרָא (BDB01439) plus 1 Strong entry
 בָּרָא² (BDB01442) plus 1 Strong entry
 בַּר³ (BDB01500) plus 4 Strong entries
 בַּר⁴ (BDB01501) plus 4 Strong entries

Let’s separate out those BDB articles that Strong identifies as verb forms. For each entry in plusentries, we therefore want to see if it has a part of speech value of v in any of its associated Strong record.

verbarticles = filter(plusentries) do plusentry
    strongs = strong(plusentry)
    !isempty(filter(st -> pos(st) == "v", strongs))
end
2-element Vector{BDBplus}:
 בָּרָא (BDB01439) plus 1 Strong entry
 בָּרָא² (BDB01442) plus 1 Strong entry

We can extract the BDB articles, and format them as HTML.

bdbarticles = bdb.(verbarticles)
formatted = html_string.(bdbarticles)
2-element Vector{String}:
 "<h3> בָּרָא</h3>\n\n<p>Article  " ⋯ 7853 bytes ⋯ "/sup>.\n</ul>\n</ul></li>\n\n</ul>"
 "<h3> בָּרָא²</h3>\n\n<p>Article  " ⋯ 432 bytes ⋯ "es fat</em>.\n</ul></li>\n\n</ul>"

A useful function

This is useful enough that we could wrap it up in a simple function.

"Find BDB articles for a given token that have a given part of speech code."
function posarticles(tkn, poscode)
    plusentries = bdbplus(tkn)
    posarticles = filter(plusentries) do plusentry
        strongs = strong(plusentry)
        !isempty(filter(st -> pos(st) == poscode, strongs))
    end
    bdb.(posarticles)
end
Main.Notebook.posarticles
posarticles("בָּרָ֣א", "v")
2-element Vector{Article}:
 בָּרָא (BDB01439)
 בָּרָא² (BDB01442)

Results

Here are the results of formatting the articles as HTML strings.

First article

formatted[1] |> HTML

בָּרָא

Article BDB01439 has 4 senses

  • vb. shape, create (cf. Arabic بَرَى, form, fashion by cutting, shape out, pare a reed for writing, a stick for an arrow; بَرَأَ, create (loan-word); Ph. הברא CISi. 347 incisor, a trade involving cutting; Assyrian barû, make, create, COTGloss & Hpt KAT2 Gloss 1 but dub.; Sab. ברא found, build, DHMZMG 1883, 413, synon. בנה; BaZA 1888, 58, comp. Assyrian banû, create, beget, with change of liquid; Aramaic בְּרָא, ܒܪܳܐ, create)
  • Qal
  • Niph.
      Pf. 2 fs. נִבְרֵאתְ Ez 21:35; 3 pl. נִבְרְאוּ Ex 34:10 + 2 times; Impf. יִבָּרֵא֑וּן ψ 104:30; Inf. sf. הִבָּרַאֲךָ Ez 28:13; הִבָּֽרְאָךְ Ez 28:15; הִבָּֽרְאָם Gn 2:4; 5:2; Pt. נִבְרָא ψ 102:19;—Pass. 1. 2.
        with reference to birth: במקום אשׁר נבראת in the place where thou wast created (i.e. native land) Ez 21:35; יום הבראך day when thou wast created (king of Tyre) Ez 28:13, 15 (cf. היום ילדתיך ψ 2:7); עַם נִבְרָא ψ 102:19 (‖ עַם נוֹלָד ψ 22:32).
      3.
        of something new, astonishing: miracles Ex 34:10 (J); new things, חדשׁית Is 48:6.
  • Pi.

Second article

formatted[2] |> HTML

בָּרָא²

Article BDB01442 has 2 senses

  • vb. be fat (Arabic بَرِئَ be free from disease, debt; v. מרא)
  • Hiph.
      Inf. לְהַבְרִיאֲכֶם 1 S 2:29 to make yourselves fat.