CACCHT

Searching the BHSA

50 search templates

Examples of Text-Fabric’s search templates on the BHSA, from a single word to whole clauses, each with the number of results it finds.

A search template describes what you look for, one object per line: a word with certain features, a phrase with a certain function, a clause that contains both. Indentation means “inside”. The examples go from words (1–18) to phrases (19–34) and clauses (35–50); the cheat sheet sums up the notation.

Running them

In CACCHT Explorer: open the BHSA, choose Search and Template, paste a template and click Search. The Explorer’s guide explains searching step by step; the Concordance shows the results as lines with the hit in the middle.

In Python, with Text-Fabric:

from tf.app import use
A = use("ETCBC/bhsa", hoist=globals())

query = """
clause
  phrase function=Pred
"""
results = A.search(query)
A.show(results, end=3)      # or A.table(results, end=10)

Context-Fabric runs the same templates with S.search(query). Lines starting with % are comments, in the Explorer as well.

The numbers are those of the BHSA, version 2021, checked with Context-Fabric 0.5.7 (Python) and 0.6.0rc1 (Rust), which give the same counts. A result is one way to match the whole template: a template with a clause and a phrase in it gives a result for every pair.

Cheat sheet

Object types, from big to small: book > chapter > verse > sentence > clause > phrase > subphrase > word. The word is the smallest unit (the “slot”).

Conditions on the line of an object, separated by spaces, all of which must hold:

sp=verbthe feature has this value
vt=wayq|impfone of these values (or)
sp#verbnot this value
lex~^>Lmatches a regular expression
freq_lex>1000a number greater than (also <)
qerethe feature has a value, whatever it is

Relations between two objects, on a line of their own (w1 < w2) or at the start of an object’s line, relating it to the object on the line above:

<comes before (anywhere); > comes after
<:comes immediately before; :> immediately after
=:starts at the same word
:=ends at the same word
==consists of exactly the same words
[[contains; ]] is contained in
-mother>an edge: the left one has the right one as its mother
.lex.both have the same value of a feature (here lex); .nu#nu.: different values

Names: put name: before an object to refer to it later, as in w1:word … w1 < w2.

Quantifiers, each ending with /-/, directly under the object they belong to and at its indentation:

/without/ … /-/the object does not contain …
/where/ A /have/ B /-/every A in the object also satisfies B
/with/ A /or/ B /-/the object contains A or B

Common values in the BHSA:

sppart of speech: verb subs nmpr adjv advb prep conj prps prde prin intj nega inrg art
vttense: perf impf wayq impv infa infc ptca ptcp
vsstem: qal nif piel pual hif hof hit …
ps gn nuperson, gender, number: p1 p2 p3, m f, sg du pl
ststate: a (absolute), c (construct), e (emphatic, Aramaic)
phrase functionPred Subj Objc Cmpl Adju Time Loca Conj Nega Ques PreO PreS PreC Voct Modi Frnt …
phrase typVP NP PP PrNP AdvP CP NegP InrP PPrP DPrP …
clause typWay0 WayX WxQ0 xQt0 WQt0 NmCl Ptcp InfC ZQt0 …
clause kindVC (verbal), NC (nominal), WP (without predicate)
clause relaObjc Attr Subj Adju Coor ReVo …
clause domainN (narrative), Q (quotation), D (discourse), ? (unknown)

Words (1–18)

1 Every verb

The simplest query: every word whose part of speech is "verb".

word sp=verb

73,710 results

2 One lexeme: BR>[ “create”

All occurrences of the lexeme BR>[ ("to create"). In BHSA lexemes are written in ETCBC transliteration; the "[" marks a verb, "/" a noun.

word lex=BR>[

48 results

3 Several features: AND

Two conditions on one line are combined with AND: verbs in the Hifil stem that are also in the wayyiqtol form.

word sp=verb vs=hif vt=wayq

1,752 results

4 One of several values: OR

The pipe | means OR within one feature: every word that is either an imperative OR an infinitive construct.

word vt=impv|infc

10,913 results

5 Not this value

Negation of a value with #: every word that is NOT Hebrew, i.e. the Aramaic words (Daniel, Ezra, Jer 10:11, Gen 31:47).

word language#Hebrew

6,106 results

6 Person, gender and number

Person, gender and number together: 2nd person feminine singular verbs.

word sp=verb ps=p2 gn=f nu=sg

778 results

7 Dual nouns in the construct state

Nouns in the construct state that are dual.

word sp=subs st=c nu=du

809 results

8 Verbs with a suffix “me”

Verbs that carry a pronominal suffix of the 1st person singular ("me", "my"). prs_ps / prs_nu / prs_gn describe the suffix.

word sp=verb prs_ps=p1 prs_nu=sg

1,372 results

9 A regular expression on the lexeme

Regular expressions with ~ : all lexemes that start with the letter aleph (">" in ETCBC transliteration).

word lex~^>

62,568 results

10 Lexemes by their gloss

Regular expression on the gloss (English translation of the lexeme). In BHSA the gloss lives on the "lex" node type (one node per lexeme, linked to all its occurrences), so we look for lexemes whose gloss contains "king" and then for the words inside those lexemes.

lex gloss~king
  word

3,529 results

11 Hapax legomena

Numeric comparison: rare words. freq_lex is the number of times the lexeme occurs in the whole Bible; here: occurs exactly once (hapax).

word freq_lex=1

3,071 results

12 Frequent nouns

Numeric comparison with > : very frequent nouns (more than 1000 times).

word sp=subs freq_lex>1000

33,889 results

13 The he locale

Proper nouns with the "he locale" ending (uvf = univalent final), the directional -ah as in MYRJMH "to Egypt".

word sp=nmpr uvf=H

280 results

14 Inside a book

Embedding in a section: all words of the lexeme >LHJM/ ("God") in the book of Genesis. Indentation means: the word lies inside the book.

book book=Genesis
  word lex=>LHJM/

219 results

15 Two adjacent words

Two words in sequence. <: means "immediately followed by": the article directly followed by an adjective.

word sp=art
<: word sp=adjv

3,282 results

16 Named words in one verse

Naming nodes and using a relation later. Within one verse, the lexeme >MR[ ("say") comes somewhere before the lexeme DBR[ ("speak").

verse
  w1:word lex=>MR[
  w2:word lex=DBR[
w1 < w2

293 results

17 The same lexeme twice in a row

Comparing features of two nodes with .f. : two adjacent words in the same verse that have the same lexeme (repetitions like "holy, holy").

verse
  w1:word
  w2:word
w1 <: w2
w1 .lex. w2

1,472 results

18 Three words in a row: “and he said” + preposition

Three adjacent words: the classic sequence "and he said" WJ>MR (conjunction + wayyiqtol of >MR[) followed by a preposition.

word lex=W
<: word lex=>MR[ vt=wayq
<: word sp=prep

819 results

Phrases (19–34)

19 Subject phrases

All phrases that function as the subject of their clause.

phrase function=Subj

31,979 results

20 Prepositional phrases

Phrase type instead of function: all prepositional phrases.

phrase typ=PP

57,483 results

21 Objects with the object marker

A phrase with a word inside it: object phrases that contain the object marker >T ("et").

phrase function=Objc
  word lex=>T

10,636 results

22 Objects without the object marker

Object phrases WITHOUT the object marker, using the /without/ quantifier.

phrase function=Objc
/without/
  word lex=>T
/-/

13,640 results

23 Time phrases with “day”

Time phrases (function=Time) that contain the noun JWM/ ("day").

phrase function=Time
  word lex=JWM/

1,678 results

24 Locatives with a proper noun

Location phrases that contain a proper noun.

phrase function=Loca
  word sp=nmpr

990 results

25 The first word of a phrase

A phrase whose FIRST word is a preposition. =: means "starts at the same slot", so the word is at the very beginning of the phrase.

p:phrase typ=PP
  w:word sp=prep
p =: w

55,734 results

26 The last word of a phrase

A phrase whose LAST word is a noun with a pronominal suffix of the third person. := means “ends at the same slot”.

p:phrase function=Subj
  w:word sp=subs prs_ps=p3
p := w

2,717 results

27 One-word phrases

Single-word phrases: the phrase occupies exactly the same slots as one word (==). Here: subject phrases consisting of only a personal pronoun.

p:phrase function=Subj
  w:word sp=prps
p == w

3,766 results

28 Nifal predicates

Predicate phrases that contain a verb in the Nifal stem.

phrase function=Pred
  word sp=verb vs=nif

3,250 results

29 Predicates with an object suffix

Predicate with object suffix (function=PreO), e.g. "he saw him".

phrase function=PreO
  word vt=wayq

1,028 results

30 Determined subjects

Determined noun phrases (det=det) that are subjects.

phrase typ=NP function=Subj det=det

11,797 results

31 Negation followed by a predicate

Two phrases in a row: a negation phrase immediately followed by a predicate phrase ("not + verb").

phrase function=Nega
<: phrase function=Pred

4,832 results

32 Addressing YHWH

Vocative phrases (direct address) that contain the name of God YHWH.

phrase function=Voct
  word lex=JHWH/

390 results

33 Either of two prepositions

/with/ ... /or/: complement phrases that contain either the preposition >L ("to") or the preposition L ("to/for").

phrase function=Cmpl
/with/
  word lex=>L
/or/
  word lex=L
/-/

13,377 results

34 Every noun plural

"Every" via /without/: noun phrases in which EVERY noun is plural. Trick: "every noun is plural" = "there is no noun that is not plural".

phrase typ=NP
/without/
  word sp=subs nu#pl
/-/

9,436 results

Clauses (35–50)

35 Nominal clauses

Nominal clauses: clauses without a finite verb (clause type NmCl).

clause typ=NmCl

11,377 results

36 Wayyiqtol clauses without an explicit subject

Wayyiqtol clauses without an explicit subject (Way0; WayX has one), in narrative (domain=N).

clause typ=Way0 domain=N

9,027 results

37 Subject before predicate

Word order within a clause: Subject before Predicate. Phrases indented under the clause lie inside it; < gives the order.

clause
  s:phrase function=Subj
  p:phrase function=Pred
s < p

5,028 results

38 Verb – subject – object

The "classic" verb-subject-object order (V-S-O). Each line that starts with < relates the node on that line to the node on the line above it.

clause
  phrase function=Pred
  < phrase function=Subj
  < phrase function=Objc

2,211 results

39 The object first

Fronted object: the object is the very first phrase of the clause (=: = starts at the same slot as the clause).

c:clause
  o:phrase function=Objc
  phrase function=Pred
c =: o

1,141 results

40 Clauses without a predicate

Clauses WITHOUT any predicate phrase (no Pred, PreO, PreS or PreC).

clause
/without/
  phrase function=Pred|PreO|PreS|PreC
/-/

7,641 results

41 Relative clauses with אשׁר

Relative clauses: clauses that are attributive (rela=Attr) and start with the relative particle >CR ("asher").

c:clause rela=Attr
  w:word lex=>CR
c =: w

3,765 results

42 Object clauses with כי

Object clauses (a whole clause functions as object of another clause), e.g. "he saw THAT it was good".

clause rela=Objc
  word lex=KJ

540 results

43 Imperatives in direct speech

Clauses inside direct speech (domain=Q) that contain an imperative.

clause domain=Q
  word vt=impv

4,301 results

44 Participle clauses in the Psalms

Participle clauses (typ=Ptcp) in the book of Psalms.

book book=Psalmi
  clause typ=Ptcp

430 results

45 A clause and its mother

Using an edge feature: a clause and its mother clause. -mother> follows the "mother" edge from the daughter to the mother. Here: infinitive construct clauses whose mother is a wayyiqtol clause.

c1:clause typ=InfC
c2:clause typ=Way0|WayX
c1 -mother> c2

1,494 results

46 Saying, then speech

Two clauses in a row: a clause with the lexeme >MR[ ("say") immediately followed by a clause in the quotation domain (the start of speech).

c1:clause
  word lex=>MR[
c2:clause domain=Q
c1 <: c2

5,070 results

47 Three levels at once

Combining all three levels: a clause that contains a subject phrase containing a proper noun, and a predicate phrase with a qal perfect verb.

clause
  phrase function=Subj
    word sp=nmpr
  phrase function=Pred
    word vs=qal vt=perf

2,533 results

48 Disagreement in number

Agreement with feature comparison: within one clause, a verb in the predicate and a noun in the subject differ in number (.nu#nu. means “nu of the left node is not equal to nu of the right node”). Useful for collective nouns.

clause
  phrase function=Pred
    v:word sp=verb nu=sg|pl
  phrase function=Subj
    s:word sp=subs nu=sg|pl
v .nu#nu. s

3,317 results

49 Clause order in a sentence, Genesis 1–11

Sentence level + clause level: sentences that consist of at least two clauses where a wayyiqtol clause is followed (not necessarily directly) by a nominal clause, in Genesis 1-11.

book book=Genesis
  chapter chapter<12
    sentence
      clause typ=Way0|WayX
      < clause typ=NmCl

9 results

50 Putting it together

A showcase that uses almost everything: in Genesis, a verbal clause (kind=VC) in narrative that starts with the conjunction, directly followed by a wayyiqtol predicate, has a subject containing a proper name, and has NO object phrase. The /without/ block sits directly under the clause line, at the clause’s indentation, so it belongs to clause c; the phrase lines after it are ordinary children of c. In the BHSA the wa- of a wayyiqtol is a phrase of its own (function=Conj), so such a clause never starts with its predicate.

book book=Genesis
  c:clause kind=VC domain=N
  /without/
    phrase function=Objc
  /-/
    j:phrase function=Conj
    p:phrase function=Pred
      word vt=wayq
    phrase function=Subj
      word sp=nmpr
c =: j
j <: p

454 results

Tips

  • Book names in the BHSA are Latin: Genesis, Exodus, Leviticus, Numeri, Deuteronomium, Josua, Judices, Samuel_I, Reges_I, Jesaia, Jeremia, Ezechiel, Psalmi, Iob, Proverbia, Daniel, Esra, …
  • Lexemes are in ETCBC transliteration: > aleph, < ayin, C shin, F sin, J yod, W waw, X chet, V tet, Y tsade, Q qof, T tav. Verbs end in [, nouns in /, and = tells apart lexemes that are spelled alike: >L is the preposition “to”, >L= the negation “not”. Unsure of a spelling? Use a regular expression (word lex~^MLK), or look the word up in the Explorer’s lexicon.
  • Some features are on other objects than you might expect: the gloss is on lex objects (one per lexeme, containing its occurrences; see example 10), and the names of books, chapters and verses are on those objects. If a search finds nothing, check the BHSA’s feature documentation.
  • A quantifier (/without/, /where/, /with/) goes directly under the object it belongs to, at the same indentation; see example 50.
  • In Python, len(A.search(query)) counts the results, and A.export(results, toDir="~/Downloads") saves them as a table. The Explorer has Statistics and Download for this.