{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Use Text-Fabric\n", "\n", "Text-Fabric is a rich API.\n", "\n", "It might pay off to look at tutorials for\n", "[various different corpora in TF](https://annotation.github.io/text-fabric/tf/about/corpora.html)." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from tf.app import use" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/html": [ "data: ~/github/among/fusus/tf/Lakhnawi/0.4" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "Text-Fabric: Text-Fabric API 8.4.12, no app configured
Data: among/fusus/tf/Lakhnawi/0.4
Features:
among/fusus/tf/Lakhnawiboxb
boxl
boxr
boxt
dir
ln
n
nice
np
otype
plain
post
posta
pre
prea
text
title
trans
oslots
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
Text-Fabric API: names N F E L T S C TF directly usable

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "A = use(\"among/fusus/tf/Lakhnawi:clone\", version=\"0.4\", writing=\"ara\", hoist=globals())" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "('piece', 'page', 'sentence', 'line', 'column', 'span', 'word')" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "F.otype.all" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "52371" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "F.otype.maxSlot" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Show the pieces" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " 0.00s 35 results\n" ] }, { "data": { "text/html": [ "

result 1

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
1
piece 1
n=1title=front
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

result 2

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
2
piece 2
n=2title=عنوانكتابفصوصالحكموخصوصالكلم
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

result 3

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
3
piece 3
n=3title=خطبةكتابفصوصالحكموخصوصالكلم
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

result 4

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
4
piece 4
n=4np=1title=فصّحكمةإلٰهيّةفيكلمةآدميّة.
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

result 5

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
5
piece 5
n=5np=2title=فصّحكمةنَفْثِيَّةفيكلمةشِـيثِيّة
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

result 6

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
6
piece 6
n=6np=3title=فصّحكمةسُـبُّوحِيّةفيكلمةنوحيّة
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

result 7

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
7
piece 7
n=7np=4title=فصّحكمةقُدُّوسِيّةفيكلمةإدريسيّة
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

result 8

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
8
piece 8
n=8np=5title=فصّحكمةمُهَيْمِيّةفيكلمةإبـراهيميّة
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

result 9

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
9
piece 9
n=9np=6title=فصّحكمةحَقِـيّةفيكلمةإسحاقـيّة
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

result 10

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
10
piece 10
n=10np=7title=فصّحكمةعَلِيَّةفيكلمةإسماعيلـيّة
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

result 11

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
11
piece 11
n=11np=8title=فصّحكمةرُوحيّةفيكلمةيعقوبـيّة
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

result 12

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
12
piece 12
n=12np=9title=فصّحكمةنوريّةفيكلمةيوسفيّة
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

result 13

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
13
piece 13
n=13np=10title=فصّحكمةأحديّةفيكلمةهوديّة
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

result 14

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
14
piece 14
n=14np=11title=فصّحكمةفاتحيّةفيكلمةصالحيّة
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

result 15

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
15
piece 15
n=15np=12title=فصّحكمةقـلبـيّةفيكلمةشعيبيّة
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

result 16

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
16
piece 16
n=16np=13title=فصّحكمةمَلَـكِيّةفيكلمةلوطيّة
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

result 17

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
17
piece 17
n=17np=14title=فصّحكمةقَدَرِيّةفيكلمةعُـزيريّة
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

result 18

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
18
piece 18
n=18np=15title=فصّحكمةنبويّةفيكلمةعيسويّة
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

result 19

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
19
piece 19
n=19np=16title=فصّحكمةرحمانيّةفيكلمةسليمانيّة
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

result 20

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
20
piece 20
n=20np=17title=فصّحكمةوجوديّةفيكلمةداوديّة
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

result 21

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
21
piece 21
n=21np=18title=فصّحكمةنَفْسِيّةفيكلمةيونسيّة
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

result 22

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
22
piece 22
n=22np=19title=فصّحكمةغيبيّةفيكلمةأيّوبيّة
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

result 23

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
23
piece 23
n=23np=20title=فصّحكمةجلاليّةفيكلمةيَحْـيَوِيَّة
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

result 24

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
24
piece 24
n=24np=21title=فصّحكمةمالكيّةفيكلمةزكـريّاويّة
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

result 25

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
25
piece 25
n=25np=22title=فصّحكمةإيـناسيّةفيكلمةإلياسيّة
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

result 26

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
26
piece 26
n=26np=23title=فصّحكمةإحسانيّةفيكلمةلقمانيّة
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

result 27

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
27
piece 27
n=27np=24title=فصّحكمةإماميّةفيكلمةهارونيّة
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

result 28

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
28
piece 28
n=28np=25title=فصّحكمةعُـلـويّةفيكلمةموسويّة
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

result 29

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
29
piece 29
n=29np=26title=فصّحكمةصمديّةفيكلمةخالديّة
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

result 30

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
30
piece 30
n=30np=27title=فصّحكمةفرديّةفيكلمةمحمديّة
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

result 31

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
34
piece 34
n=34title=الملحقات
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

result 32

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
35
piece 35
n=35title=ملحق١:تعليقاتداخلالمخطوط
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

result 33

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
36
piece 36
n=36title=ملحق٢:تحقيقفيمسألةالذبيح
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

result 34

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
37
piece 37
n=37title=ملحق٣:تحقيقفيخالدبنسنان
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

result 35

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
38
piece 38
n=38title=ملحق٤:تخريجحديثالتحول
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "results = A.search(\"\"\"\n", "piece n* np* title*\n", "\"\"\")\n", "A.show(results)" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[(63039,),\n", " (63040,),\n", " (63041,),\n", " (63042,),\n", " (63043,),\n", " (63044,),\n", " (63045,),\n", " (63046,),\n", " (63047,),\n", " (63048,),\n", " (63049,),\n", " (63050,),\n", " (63051,),\n", " (63052,),\n", " (63053,),\n", " (63054,),\n", " (63055,),\n", " (63056,),\n", " (63057,),\n", " (63058,),\n", " (63059,),\n", " (63060,),\n", " (63061,),\n", " (63062,),\n", " (63063,),\n", " (63064,),\n", " (63065,),\n", " (63066,),\n", " (63067,),\n", " (63068,),\n", " (63069,),\n", " (63070,),\n", " (63071,),\n", " (63072,),\n", " (63073,)]" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "results" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "All words on the first line of every page" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [], "source": [ "template = \"\"\"\n", "line ln=1\n", " word\n", "\"\"\"" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " 0.06s 4432 results\n" ] } ], "source": [ "results = A.search(template)" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[(57536, 1),\n", " (57536, 2),\n", " (57546, 23),\n", " (57546, 24),\n", " (57546, 25),\n", " (57549, 29),\n", " (57549, 30),\n", " (57549, 31),\n", " (57549, 32),\n", " (57560, 89)]" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "results[0:10]" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
nplineword
11 1:1فصوص
21 1:1الحكم
31 2:1جميع
41 2:1الحقوق
51 2:1محفوظة
61 3:1بِسمِ
71 3:1اللهِ
81 3:1الرَّحْمٰـنِ
91 3:1الرَّحِيمِ
101 4:1الفهرست
111 5:1٩١‐
121 5:1[٦١]
131 5:1فصّ
141 5:1حكمة
151 5:1رحمانيّة
161 5:1في
171 5:1كلمة
181 5:1سليمانيّة……………………
191 5:1٢٤٢
202 6:1[١وجه]
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "A.table(results, end=20)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "All first words of the first line of every page" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " 0.05s 438 results\n" ] }, { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
nplineword
11 1:1فصوص
21 2:1جميع
31 3:1بِسمِ
41 4:1الفهرست
51 5:1٩١‐
62 6:1[١وجه]
72 7:1[١ظهر]
83 8:1[خُطْـبَةُ
93 9:1وَصَل
103 10:1فَقُلْتُ:
113 11:1الرُّوعِ
123 12:1يُنْزَلُ
133 13:1وَمِنَ
144 14:1[١]﴿
154 15:1جَامِـعٍ
164 16:1فَـكَانَكَمِرآةٍ
174 17:1فَـكَانَتِ
184 18:1وَهٰذَا
194 19:1أَلَا
204 20:1فَإِن
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "template = \"\"\"\n", "line ln=1\n", " =: word\n", "\"\"\"\n", "results = A.search(template)\n", "A.table(results, end=20)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "All last words of the first line of every page" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " 0.05s 438 results\n" ] }, { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
nplineword
11 1:1الحكم
21 2:1محفوظة
31 3:1الرَّحِيمِ
41 4:1الفهرست
51 5:1٢٤٢
62 6:1[١وجه]
72 7:1[١ظهر]
83 8:1ِّفِ]
93 9:1بِالقِيلِ
103 10:1أُمِرْنَا».
113 11:1ِّمًا،
123 12:1حَارِثٌ.
133 13:1َّرْعِ
144 14:1آدَمِيَّةٍ﴾
154 15:1إِلَـيهِ.
164 16:1َّا
174 17:1َّشْأَةِ
184 18:1الإِدْرَاكِ
194 19:1الحَقُّ
204 20:1جَمْعِيَّةُ
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "template = \"\"\"\n", "line ln=1\n", " := word\n", "\"\"\"\n", "results = A.search(template)\n", "A.table(results, end=20)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "All first words of a piece" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " 0.06s 35 results\n" ] }, { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
nppieceword
11 1:11فصوص
22 6:12[١وجه]
33 8:13[خُطْـبَةُ
44 14:14[١]﴿
55 32:15[٢]
66 52:16وَهُوَ
77 71:17المَنَازِلِ،
88 84:18كَمَا
99 95:19٣‐
1010 111:110وَلِهٰذَا
1111 121:111إِن
1212 130:112[٩]﴿
1313 147:113فَأَسْمَاؤُنَا
1414 166:114تُسَمَّىٰ
1515 173:115الأَشْقِيَاءٍِ:
1616 189:116وَلَا
1717 198:117هِي
1818 211:118وَغَيْرِهِ.
1919 242:119هٰذِهِ
2020 262:120وَإذِا
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "template = \"\"\"\n", "piece\n", " =: word\n", "\"\"\"\n", "results = A.search(template)\n", "A.table(results, end=20)" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
4 14:1  [١]﴿فَصُّ حِكْمَةٍ إِلٰهِيَّةٍ فِي كَلِمَةٍ آدَمِيَّةٍ﴾
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "ln = A.nodeFromSectionStr(\"4 14:1\")\n", "A.plain(ln)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Pick line 500" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "58035" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "l = F.otype.s(\"line\")[499]\n", "l" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Where is it?" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
5 45:17  أَوْ عَلَىٰ يَدِ «الجَبَّارِ» فَـيَنْظُـرُ فِي المَوْطِنِ وَمَا يَسْتَحِق ُّهُ.
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "A.plain(l)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Show structure" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
5 45:17
line
column
span
أَوْ
عَلَىٰ
يَدِ
«الجَبَّارِ»
فَـيَنْظُـرُ
فِي
المَوْطِنِ
وَمَا
يَسْتَحِق
ُّهُ.
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "A.pretty(l)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Show more info" ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
5 45:17
line
column
n=1
span
n=1
أَوْ
عَلَىٰ
يَدِ
«الجَبَّارِ»
فَـيَنْظُـرُ
فِي
المَوْطِنِ
وَمَا
يَسْتَحِق
ُّهُ.
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "A.pretty(l, extraFeatures=\"n\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Locate a specific portion" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " 0.09s 35 results\n" ] }, { "data": { "text/html": [ "

line 1

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
5 32:2
line
column
n=1
span
n=1
ٱعْلَمْ
text=ٱعْلَمْ
أَن
text=أَن
َّ
text=َّ
العَطَايَا
text=العَطَايَا
وَالمِنَحَ
text=وَالمِنَحَ
الظ
text=الظ
َّاهِـرَةَ
text=َّاهِـرَةَ
فِي
text=فِي
الكَونِ
text=الكَونِ
text=
عَلَىٰ
text=عَلَىٰ
أَيْدِي
text=أَيْدِي
العِبَادِ
text=العِبَادِ
وَعَلَىٰ
text=وَعَلَىٰ
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

line 2

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
5 32:3
line
column
n=1
span
n=1
غَيْرِ
text=غَيْرِ
أَيْدِيهِمْ
text=أَيْدِيهِمْ
text=
عَلَىٰ
text=عَلَىٰ
قِسْمَيْنِ:
text=قِسْمَيْنِ
مِنْهَا،
text=مِنْهَا
مَاتَـكُونُ
text=مَاتَـكُونُ
عَطَايَا
text=عَطَايَا
ذَاتِيَّةً
text=ذَاتِيَّةً
وَعَطَايَا
text=وَعَطَايَا
أَسْمَائِيَّةً،
text=أَسْمَائِيَّةً
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

line 3

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
5 32:4
line
column
n=1
span
n=1
وَتَتَمَيَّزُ
text=وَتَتَمَيَّزُ
عِنْدَ
text=عِنْدَ
أَهْلِ
text=أَهْلِ
الأَذْوَاقِ.
text=الأَذْوَاقِ
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

line 4

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
5 32:5
line
column
n=1
span
n=1
كَمَا
text=كَمَا
أَن
text=أَن
َّ
text=َّ
مِنْهَا
text=مِنْهَا
مَاتَـكُونُ
text=مَاتَـكُونُ
عَنْ
text=عَنْ
سُؤالٍ
text=سُؤالٍ
فِي
text=فِي
مُعَـيَّنٍ،
text=مُعَـيَّنٍ
وَعَنْ
text=وَعَنْ
سُؤالٍ
text=سُؤالٍ
غَـيْرِ
text=غَـيْرِ
مُعَـيَّنٍ.
text=مُعَـيَّنٍ
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

line 5

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
5 32:6
line
column
n=1
span
n=1
وَمِنْهَا:
text=وَمِنْهَا
مَالَا
text=مَالَا
يَكُونُ
text=يَكُونُ
عَنْ
text=عَنْ
سُؤالٍ،
text=سُؤالٍ
سَوَاءٌكَانَتْ
text=سَوَاءٌكَانَتْ
الأُعْطِيَةُ
text=الأُعْطِيَةُ
ذَاتِيَّةً
text=ذَاتِيَّةً
أَوْ
text=أَوْ
أَسْمَائِيَّةً.
text=أَسْمَائِيَّةً
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

line 6

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
5 32:7
line
column
n=1
span
n=1
فَالمُعَيَّنُ
text=فَالمُعَيَّنُ
كَمَنْ
text=كَمَنْ
يَقُولُ:
text=يَقُولُ
«يَا
text=يَا
رَبِّ
text=رَبِّ
أَعْطِنِي
text=أَعْطِنِي
كَذَا».
text=كَذَا
فَيُعَـيِّنُ
text=فَيُعَـيِّنُ
أَمْـرًا
text=أَمْـرًا
مَا،
text=مَا
لَا
text=لَا
يَخْطُـرُ
text=يَخْطُـرُ
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

line 7

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
5 32:8
line
column
n=1
span
n=1
لَهُ
text=لَهُ
سِوَاهُ.
text=سِوَاهُ
وَغَيرُ
text=وَغَيرُ
المُعَيَّنِ
text=المُعَيَّنِ
كَمَنْ
text=كَمَنْ
يَقُولُ:
text=يَقُولُ
«يَا
text=يَا
رَبِّ
text=رَبِّ
أَعْطِنِي
text=أَعْطِنِي
مَاتَعْلَمُ
text=مَاتَعْلَمُ
فِيهِ
text=فِيهِ
مَصْلَحَتِي»،
text=مَصْلَحَتِي
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "template = \"\"\"\n", "piece n=5\n", " =: page\n", " line\n", " word text~ا\n", "\"\"\"\n", "results = A.search(template)\n", "A.show(results, condensed=True)" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [ { "data": { "text/html": [ "

line 1

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
5 32:2
line
column
n=1
span
n=1
ٱعْلَمْ
text=ٱعْلَمْ
أَن
text=أَن
َّ
text=َّ
العَطَايَا
text=العَطَايَا
وَالمِنَحَ
text=وَالمِنَحَ
الظ
text=الظ
َّاهِـرَةَ
text=َّاهِـرَةَ
فِي
text=فِي
الكَونِ
text=الكَونِ
text=
عَلَىٰ
text=عَلَىٰ
أَيْدِي
text=أَيْدِي
العِبَادِ
text=العِبَادِ
وَعَلَىٰ
text=وَعَلَىٰ
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

line 2

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
5 32:3
line
column
n=1
span
n=1
غَيْرِ
text=غَيْرِ
أَيْدِيهِمْ
text=أَيْدِيهِمْ
text=
عَلَىٰ
text=عَلَىٰ
قِسْمَيْنِ:
text=قِسْمَيْنِ
مِنْهَا،
text=مِنْهَا
مَاتَـكُونُ
text=مَاتَـكُونُ
عَطَايَا
text=عَطَايَا
ذَاتِيَّةً
text=ذَاتِيَّةً
وَعَطَايَا
text=وَعَطَايَا
أَسْمَائِيَّةً،
text=أَسْمَائِيَّةً
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

line 3

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
5 32:4
line
column
n=1
span
n=1
وَتَتَمَيَّزُ
text=وَتَتَمَيَّزُ
عِنْدَ
text=عِنْدَ
أَهْلِ
text=أَهْلِ
الأَذْوَاقِ.
text=الأَذْوَاقِ
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

line 4

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
5 32:5
line
column
n=1
span
n=1
كَمَا
text=كَمَا
أَن
text=أَن
َّ
text=َّ
مِنْهَا
text=مِنْهَا
مَاتَـكُونُ
text=مَاتَـكُونُ
عَنْ
text=عَنْ
سُؤالٍ
text=سُؤالٍ
فِي
text=فِي
مُعَـيَّنٍ،
text=مُعَـيَّنٍ
وَعَنْ
text=وَعَنْ
سُؤالٍ
text=سُؤالٍ
غَـيْرِ
text=غَـيْرِ
مُعَـيَّنٍ.
text=مُعَـيَّنٍ
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

line 5

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
5 32:6
line
column
n=1
span
n=1
وَمِنْهَا:
text=وَمِنْهَا
مَالَا
text=مَالَا
يَكُونُ
text=يَكُونُ
عَنْ
text=عَنْ
سُؤالٍ،
text=سُؤالٍ
سَوَاءٌكَانَتْ
text=سَوَاءٌكَانَتْ
الأُعْطِيَةُ
text=الأُعْطِيَةُ
ذَاتِيَّةً
text=ذَاتِيَّةً
أَوْ
text=أَوْ
أَسْمَائِيَّةً.
text=أَسْمَائِيَّةً
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

line 6

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
5 32:7
line
column
n=1
span
n=1
فَالمُعَيَّنُ
text=فَالمُعَيَّنُ
كَمَنْ
text=كَمَنْ
يَقُولُ:
text=يَقُولُ
«يَا
text=يَا
رَبِّ
text=رَبِّ
أَعْطِنِي
text=أَعْطِنِي
كَذَا».
text=كَذَا
فَيُعَـيِّنُ
text=فَيُعَـيِّنُ
أَمْـرًا
text=أَمْـرًا
مَا،
text=مَا
لَا
text=لَا
يَخْطُـرُ
text=يَخْطُـرُ
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

line 7

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
5 32:8
line
column
n=1
span
n=1
لَهُ
text=لَهُ
سِوَاهُ.
text=سِوَاهُ
وَغَيرُ
text=وَغَيرُ
المُعَيَّنِ
text=المُعَيَّنِ
كَمَنْ
text=كَمَنْ
يَقُولُ:
text=يَقُولُ
«يَا
text=يَا
رَبِّ
text=رَبِّ
أَعْطِنِي
text=أَعْطِنِي
مَاتَعْلَمُ
text=مَاتَعْلَمُ
فِيهِ
text=فِيهِ
مَصْلَحَتِي»،
text=مَصْلَحَتِي
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "A.show(results, condensed=True, extraFeatures=\"n title\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python3.9", "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.0" } }, "nbformat": 4, "nbformat_minor": 4 }