"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "# The following will push the Text-Fabric stylesheet to this notebook (to facilitate proper display with notebook viewer)\n",
+ "N1904.dh(N1904.getCss())"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "3e383881-2356-4704-97fd-c8a676abf6e9",
+ "metadata": {},
+ "source": [
+ "Note: to access the feature descriptions click here"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "38ba1e92-4459-4e4c-bb07-3b002d1a60a3",
+ "metadata": {},
+ "source": [
+ "# 3 - Performing the queries \n",
+ "##### [Back to TOC](#TOC)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "e0204b00-a2dc-43f2-9968-86b57d29e8f9",
+ "metadata": {},
+ "source": [
+ "First we will define a query template to select John 1:1."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "id": "12aed999-b3fb-4d0a-95ad-1b2e2a62debc",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " 0.02s 21 results\n"
+ ]
+ }
+ ],
+ "source": [
+ "VerseQuery = '''\n",
+ "book book=John\n",
+ " chapter chapter=1\n",
+ " verse verse=1\n",
+ "'''\n",
+ "\n",
+ "VerseResults = N1904.search(VerseQuery)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "a429cfff-e434-44be-a6fe-7c234e4e63a9",
+ "metadata": {
+ "tags": []
+ },
+ "source": [
+ "# 4 - The syntax tree presentation\n",
+ "##### [Back to TOC](#TOC)\n",
+ "\n",
+ "The data set allows for different types of tree presentation:"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "2ddf7f23-8d7e-4bcd-a495-ac89894d3468",
+ "metadata": {},
+ "source": [
+ "## 4.1- View 1: combined view (display all nodes)\n",
+ "##### [Back to TOC](#TOC)\n",
+ "\n",
+ "The following will show John 1:1 with all nodes visable."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "id": "0a51ca20-ca23-4e81-a381-6131be641caa",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "verse 1"
+ ],
+ "text/plain": [
+ ""
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ },
+ {
+ "data": {
+ "text/html": [
+ "verse
book=Johnchapter=1verse=1
sentence
book=John
clause
book=John
wg
wg
book=John
wg
phrase
phrase
subphrase
Ἐν
book=Johnchapter=1verse=1
subphrase
ἀρχῇ
book=Johnchapter=1verse=1
phrase
phrase
ἦν
book=Johnchapter=1verse=1
wg
phrase
phrase
subphrase
ὁ
book=Johnchapter=1verse=1
subphrase
Λόγος,
book=Johnchapter=1verse=1
clause
wg
wg
phrase
phrase
καὶ
book=Johnchapter=1verse=1
clause
book=John
wg
wg
wg
book=John
wg
phrase
phrase
subphrase
ὁ
book=Johnchapter=1verse=1
subphrase
Λόγος
book=Johnchapter=1verse=1
phrase
phrase
ἦν
book=Johnchapter=1verse=1
wg
phrase
phrase
subphrase
πρὸς
book=Johnchapter=1verse=1
wg
phrase
phrase
phrase
subphrase
τὸν
book=Johnchapter=1verse=1
subphrase
Θεόν,
book=Johnchapter=1verse=1
clause
wg
wg
phrase
phrase
καὶ
book=Johnchapter=1verse=1
clause
book=John
wg
wg
wg
book=John
phrase
phrase
Θεὸς
book=Johnchapter=1verse=1
phrase
ἦν
book=Johnchapter=1verse=1
wg
phrase
phrase
subphrase
ὁ
book=Johnchapter=1verse=1
subphrase
Λόγος.
book=Johnchapter=1verse=1
"
+ ],
+ "text/plain": [
+ ""
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "N1904.show(VerseResults, start=1, end=1, condensed=True, multiFeatures=False)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "6fe4843b-e69c-4c3d-8469-7770f456d084",
+ "metadata": {},
+ "source": [
+ "## 4.2- View 2: syntactic view (no display of wordgroup nodes)\n",
+ "##### [Back to TOC](#TOC)\n",
+ "\n",
+ "When the display of word groups is switched off, the tree contain all syntactical relevant detail, presented in a much easier to understand manner."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "id": "42203fe4-dc23-4fb5-8aeb-e227c988f2b2",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "verse 1"
+ ],
+ "text/plain": [
+ ""
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ },
+ {
+ "data": {
+ "text/html": [
+ "verse
book=Johnchapter=1verse=1
sentence
book=John
clause
book=John
phrase
phrase
subphrase
Ἐν
book=Johnchapter=1verse=1
subphrase
ἀρχῇ
book=Johnchapter=1verse=1
phrase
ἦν
book=Johnchapter=1verse=1
phrase
subphrase
ὁ
book=Johnchapter=1verse=1
subphrase
Λόγος,
book=Johnchapter=1verse=1
clause
phrase
phrase
καὶ
book=Johnchapter=1verse=1
clause
book=John
phrase
phrase
subphrase
ὁ
book=Johnchapter=1verse=1
subphrase
Λόγος
book=Johnchapter=1verse=1
phrase
ἦν
book=Johnchapter=1verse=1
phrase
subphrase
πρὸς
book=Johnchapter=1verse=1
phrase
subphrase
τὸν
book=Johnchapter=1verse=1
subphrase
Θεόν,
book=Johnchapter=1verse=1
clause
phrase
phrase
καὶ
book=Johnchapter=1verse=1
clause
book=John
phrase
phrase
Θεὸς
book=Johnchapter=1verse=1
phrase
ἦν
book=Johnchapter=1verse=1
phrase
subphrase
ὁ
book=Johnchapter=1verse=1
subphrase
Λόγος.
book=Johnchapter=1verse=1
"
+ ],
+ "text/plain": [
+ ""
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "N1904.show(VerseResults, start=1, end=1, condensed=True, hiddenTypes={\"wg\"}, multiFeatures=False)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "b1936f5e-cbfd-412c-bfa8-1c5ddfc48d7a",
+ "metadata": {},
+ "source": [
+ "## 4.3- View 3: XML source view (no display of clause, phrase, or subphrase nodes)\n",
+ "##### [Back to TOC](#TOC)\n",
+ "\n",
+ "When the display of clause, phrase and subphrase nodes is switched off, the tree is presented 'as found' in the XML source data."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "id": "8afa10de-6fff-403b-84d2-fc834a96665d",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "verse 1"
+ ],
+ "text/plain": [
+ ""
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ },
+ {
+ "data": {
+ "text/html": [
+ "verse
book=Johnchapter=1verse=1
sentence
book=John
wg
wg
book=John
wg
Ἐν
book=Johnchapter=1verse=1
ἀρχῇ
book=Johnchapter=1verse=1
ἦν
book=Johnchapter=1verse=1
wg
ὁ
book=Johnchapter=1verse=1
Λόγος,
book=Johnchapter=1verse=1
wg
καὶ
book=Johnchapter=1verse=1
wg
book=John
wg
ὁ
book=Johnchapter=1verse=1
Λόγος
book=Johnchapter=1verse=1
ἦν
book=Johnchapter=1verse=1
wg
πρὸς
book=Johnchapter=1verse=1
wg
τὸν
book=Johnchapter=1verse=1
Θεόν,
book=Johnchapter=1verse=1
wg
καὶ
book=Johnchapter=1verse=1
wg
book=John
Θεὸς
book=Johnchapter=1verse=1
ἦν
book=Johnchapter=1verse=1
wg
ὁ
book=Johnchapter=1verse=1
Λόγος.
book=Johnchapter=1verse=1
"
+ ],
+ "text/plain": [
+ ""
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "N1904.show(VerseResults, start=1, end=1, condensed=True, hiddenTypes={\"clause\",\"phrase\",\"subphrase\"}, multiFeatures=False)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "bc140c69-1a21-47fc-899b-461d339d5e2e",
+ "metadata": {},
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 3 (ipykernel)",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.9.12"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 5
+}