Work in progress
TBD
Since we are looking for situations where someone or something is speaking to an object, we first need to look for phrases with function 'Object function' (O).
It is using the classification by Louw-Nida:
1 Geographical Objects and Features 2 Natural Substances 3 Plants 4 Animals 5 Foods and Condiments 6 Artifacts 7 Constructions
%load_ext autoreload
%autoreload 2
# Loading the Text-Fabric code
# Note: it is assumed Text-Fabric is installed in your environment
from tf.fabric import Fabric
from tf.app import use
# load the N1904 app and data
N1904 = use ("tonyjurg/Nestle1904GBI", version="0.4", hoist=globals())
Locating corpus resources ...
Name | # of nodes | # slots/node | % coverage |
---|---|---|---|
book | 27 | 5102.93 | 100 |
chapter | 260 | 529.92 | 100 |
sentence | 5720 | 24.09 | 100 |
verse | 7943 | 17.35 | 100 |
clause | 16124 | 8.54 | 100 |
phrase | 72674 | 1.90 | 100 |
word | 137779 | 1.00 | 100 |
# The following will push the Text-Fabric stylesheet to this notebook (to facilitate proper display with notebook viewer)
N1904.dh(N1904.getCss())
For demonstration purposes the table output is limited to 3 results.
# Define the query template
SearchObjectPhrases = '''
book
chapter
clause
a:phrase phrasefunction=V
word lemma=λέγω
b:phrase phrasefunction=O
word ln~^[12345679]\.
'''
# The following will create a list containing ordered tuples consisting of node numbers of the items as they appear in the query
ObjectPhrasesList = N1904.search(SearchObjectPhrases)
# Just print a few of the results in a table
N1904.table(ObjectPhrasesList, condensed=False, extraFeatures={'lemma'}, end=3)
0.35s 211 results
n | p | book | chapter | clause | phrase | word | phrase | word |
---|---|---|---|---|---|---|---|---|
1 | Matthew 2:13 | Matthew | Matthew 2 | ἰδοὺ ἄγγελος κυρίου φαίνεται κατ’ ὄναρ τῷ Ἰωσὴφ λέγων Ἐγερθεὶς παράλαβε τὸ παιδίον καὶ τὴν μητέρα αὐτοῦ καὶ φεῦγε εἰς Αἴγυπτον, | λέγων Ἐγερθεὶς παράλαβε | λέγων | τὸ παιδίον καὶ τὴν μητέρα αὐτοῦ καὶ | παιδίον |
2 | Matthew 2:13 | Matthew | Matthew 2 | καὶ ἴσθι ἐκεῖ ἕως ἂν εἴπω σοι· μέλλει γὰρ Ἠρῴδης ζητεῖν τὸ παιδίον τοῦ ἀπολέσαι αὐτό. | εἴπω | εἴπω | τὸ παιδίον | παιδίον |
3 | Matthew 2:20 | Matthew | Matthew 2 | ἰδοὺ ἄγγελος Κυρίου φαίνεται κατ’ ὄναρ τῷ Ἰωσὴφ ἐν Αἰγύπτῳ λέγων Ἐγερθεὶς παράλαβε τὸ παιδίον καὶ τὴν μητέρα αὐτοῦ καὶ πορεύου εἰς γῆν Ἰσραήλ· τεθνήκασιν γὰρ οἱ ζητοῦντες τὴν ψυχὴν τοῦ παιδίου. | λέγων Ἐγερθεὶς παράλαβε | λέγων | τὸ παιδίον καὶ τὴν μητέρα αὐτοῦ καὶ | παιδίον |
Another method to display a limit amount of output, this time using plainTuple
is the following:
# Limit the query result to 1
TruncatedObjectPhrasesList = N1904.search(SearchObjectPhrases,limit=1)
for NodesTuple in TruncatedObjectPhrasesList: N1904.plainTuple(NodesTuple)
0.34s 1 result
n | p | book | chapter | clause | phrase | word | phrase | word |
---|---|---|---|---|---|---|---|---|
Matthew 2:13 | Matthew | Matthew 2 | ἰδοὺ ἄγγελος κυρίου φαίνεται κατ’ ὄναρ τῷ Ἰωσὴφ λέγων Ἐγερθεὶς παράλαβε τὸ παιδίον καὶ τὴν μητέρα αὐτοῦ καὶ φεῦγε εἰς Αἴγυπτον, | λέγων Ἐγερθεὶς παράλαβε | λέγων | τὸ παιδίον καὶ τὴν μητέρα αὐτοῦ καὶ | παιδίον |
For demonstration purposes the table output is limited to the first 10 results. the query as it is now only selects the use of 'lego'
MaxNumberOfResuls=10
ThisResult=0
for node in F.lemma.s('λέγω'):
ThisResult+=1
gloss=F.gloss.v(node)
# Following line creates a nicely formated presentation of the verse
VerseLocation=N1904.sectionStrFromNode(node)
# The following is an alternative allowing free formating:
# VerseLocation="{} {}:{}".format(F.book.v(node),F.chapter.v(node),F.verse.v(node))
print('\n',ThisResult,'\t',VerseLocation)
if ThisResult == MaxNumberOfResuls: break
1 Matthew 1:16 2 Matthew 1:20 3 Matthew 1:22 4 Matthew 2:2 5 Matthew 2:5 6 Matthew 2:8 7 Matthew 2:13 8 Matthew 2:13 9 Matthew 2:15 10 Matthew 2:17
The scripts in this notebook require (beside text-fabric
) the following Python libraries to be installed in the environment:
{none}
You can install any missing library from within Jupyter Notebook using eitherpip
or pip3
.