Version: 0.1 (May. 13, 2024).
This notebook is utilizing the module tf.dataset.nodemaps. See also the description provided with the module.
Your environment should (for obvious reasons) include the Python package Text-Fabric
. If not installed yet, it can be installed using pip
. Further it is required to be able to invoke the Text-Fabric data sets (either from an online resource, or from a localy stored copy).
See also notebook map.ipynb.
See dataset.Versions in the Text-Fabric documentation.
%load_ext autoreload
%autoreload 2
# Loading the Text-Fabric code and module versions
from tf.fabric import Fabric
from tf.dataset import Versions
from tf.app import use
va = "0.5.6" #
vb = "0.5.7" #
for v in (va, vb):
TF[v] = Fabric(locations=TF_DIR, modules=v)
api[v] = TF[v].load(features[v])
--------------------------------------------------------------------------- NameError Traceback (most recent call last) Cell In[25], line 10 7 vb = "0.5.7" # 9 for v in (va, vb): ---> 10 TF[v] = Fabric(locations=TF_DIR, modules=v) 11 api[v] = TF[v].load(features[v]) NameError: name 'TF_DIR' is not defined
# also required: module marimo
!pip install marimo
Collecting marimo Downloading marimo-0.5.2-py3-none-any.whl.metadata (26 kB) Requirement already satisfied: click<9,>=8.0 in c:\users\tonyj\anaconda3\envs\text-fabric\lib\site-packages (from marimo) (8.1.7) Requirement already satisfied: jedi>=0.18.0 in c:\users\tonyj\anaconda3\envs\text-fabric\lib\site-packages (from marimo) (0.18.1) Requirement already satisfied: markdown<4,>=3.4 in c:\users\tonyj\anaconda3\envs\text-fabric\lib\site-packages (from marimo) (3.5.1) Collecting pymdown-extensions<11,>=9.0 (from marimo) Downloading pymdown_extensions-10.8.1-py3-none-any.whl.metadata (3.0 kB) Requirement already satisfied: pygments<3,>=2.13 in c:\users\tonyj\anaconda3\envs\text-fabric\lib\site-packages (from marimo) (2.15.1) Collecting tomlkit>=0.12.0 (from marimo) Downloading tomlkit-0.12.5-py3-none-any.whl.metadata (2.7 kB) Collecting uvicorn>=0.22.0 (from marimo) Downloading uvicorn-0.29.0-py3-none-any.whl.metadata (6.3 kB) Collecting starlette!=0.36.0,>=0.26.1 (from marimo) Downloading starlette-0.37.2-py3-none-any.whl.metadata (5.9 kB) Collecting websockets<13.0.0,>=10.0.0 (from marimo) Downloading websockets-12.0-cp311-cp311-win_amd64.whl.metadata (6.8 kB) Collecting docutils>=0.17.0 (from marimo) Downloading docutils-0.21.2-py3-none-any.whl.metadata (2.8 kB) Requirement already satisfied: psutil>=5.0 in c:\users\tonyj\anaconda3\envs\text-fabric\lib\site-packages (from marimo) (5.9.0) Collecting black (from marimo) Downloading black-24.4.2-cp311-cp311-win_amd64.whl.metadata (77 kB) ---------------------------------------- 0.0/77.1 kB ? eta -:--:-- ---------------------------------------- 77.1/77.1 kB 2.1 MB/s eta 0:00:00 Requirement already satisfied: colorama in c:\users\tonyj\anaconda3\envs\text-fabric\lib\site-packages (from click<9,>=8.0->marimo) (0.4.6) Requirement already satisfied: parso<0.9.0,>=0.8.0 in c:\users\tonyj\anaconda3\envs\text-fabric\lib\site-packages (from jedi>=0.18.0->marimo) (0.8.3) Collecting markdown<4,>=3.4 (from marimo) Downloading Markdown-3.6-py3-none-any.whl.metadata (7.0 kB) Requirement already satisfied: pyyaml in c:\users\tonyj\anaconda3\envs\text-fabric\lib\site-packages (from pymdown-extensions<11,>=9.0->marimo) (6.0.1) Requirement already satisfied: anyio<5,>=3.4.0 in c:\users\tonyj\anaconda3\envs\text-fabric\lib\site-packages (from starlette!=0.36.0,>=0.26.1->marimo) (3.5.0) Requirement already satisfied: h11>=0.8 in c:\users\tonyj\anaconda3\envs\text-fabric\lib\site-packages (from uvicorn>=0.22.0->marimo) (0.14.0) Collecting mypy-extensions>=0.4.3 (from black->marimo) Downloading mypy_extensions-1.0.0-py3-none-any.whl.metadata (1.1 kB) Requirement already satisfied: packaging>=22.0 in c:\users\tonyj\anaconda3\envs\text-fabric\lib\site-packages (from black->marimo) (23.1) Collecting pathspec>=0.9.0 (from black->marimo) Downloading pathspec-0.12.1-py3-none-any.whl.metadata (21 kB) Requirement already satisfied: platformdirs>=2 in c:\users\tonyj\anaconda3\envs\text-fabric\lib\site-packages (from black->marimo) (3.10.0) Requirement already satisfied: idna>=2.8 in c:\users\tonyj\anaconda3\envs\text-fabric\lib\site-packages (from anyio<5,>=3.4.0->starlette!=0.36.0,>=0.26.1->marimo) (3.4) Requirement already satisfied: sniffio>=1.1 in c:\users\tonyj\anaconda3\envs\text-fabric\lib\site-packages (from anyio<5,>=3.4.0->starlette!=0.36.0,>=0.26.1->marimo) (1.2.0) Downloading marimo-0.5.2-py3-none-any.whl (10.1 MB) ---------------------------------------- 0.0/10.1 MB ? eta -:--:-- - -------------------------------------- 0.3/10.1 MB 6.9 MB/s eta 0:00:02 -- ------------------------------------- 0.7/10.1 MB 6.9 MB/s eta 0:00:02 ---- ----------------------------------- 1.0/10.1 MB 7.2 MB/s eta 0:00:02 ---- ----------------------------------- 1.1/10.1 MB 6.1 MB/s eta 0:00:02 ----- ---------------------------------- 1.3/10.1 MB 5.4 MB/s eta 0:00:02 ------ --------------------------------- 1.6/10.1 MB 5.5 MB/s eta 0:00:02 ------- -------------------------------- 1.9/10.1 MB 5.7 MB/s eta 0:00:02 -------- ------------------------------- 2.2/10.1 MB 5.9 MB/s eta 0:00:02 ---------- ----------------------------- 2.5/10.1 MB 6.0 MB/s eta 0:00:02 ----------- ---------------------------- 2.9/10.1 MB 6.1 MB/s eta 0:00:02 ------------ --------------------------- 3.1/10.1 MB 6.0 MB/s eta 0:00:02 ------------- -------------------------- 3.5/10.1 MB 6.2 MB/s eta 0:00:02 --------------- ------------------------ 3.8/10.1 MB 6.2 MB/s eta 0:00:02 ---------------- ----------------------- 4.1/10.1 MB 6.3 MB/s eta 0:00:01 ----------------- ---------------------- 4.5/10.1 MB 6.3 MB/s eta 0:00:01 ------------------- -------------------- 4.8/10.1 MB 6.4 MB/s eta 0:00:01 -------------------- ------------------- 5.2/10.1 MB 6.5 MB/s eta 0:00:01 --------------------- ------------------ 5.5/10.1 MB 6.6 MB/s eta 0:00:01 ----------------------- ---------------- 5.8/10.1 MB 6.5 MB/s eta 0:00:01 ------------------------ --------------- 6.1/10.1 MB 6.5 MB/s eta 0:00:01 ------------------------- -------------- 6.5/10.1 MB 6.6 MB/s eta 0:00:01 --------------------------- ------------ 6.8/10.1 MB 6.6 MB/s eta 0:00:01 --------------------------- ------------ 7.0/10.1 MB 6.7 MB/s eta 0:00:01 ---------------------------- ----------- 7.1/10.1 MB 6.3 MB/s eta 0:00:01 ----------------------------- ---------- 7.4/10.1 MB 6.3 MB/s eta 0:00:01 ------------------------------ --------- 7.7/10.1 MB 6.3 MB/s eta 0:00:01 ------------------------------- -------- 8.0/10.1 MB 6.3 MB/s eta 0:00:01 --------------------------------- ------ 8.3/10.1 MB 6.3 MB/s eta 0:00:01 ---------------------------------- ----- 8.6/10.1 MB 6.4 MB/s eta 0:00:01 ---------------------------------- ----- 8.7/10.1 MB 6.3 MB/s eta 0:00:01 ----------------------------------- ---- 8.8/10.1 MB 6.1 MB/s eta 0:00:01 ----------------------------------- ---- 8.9/10.1 MB 6.0 MB/s eta 0:00:01 ------------------------------------ --- 9.1/10.1 MB 5.9 MB/s eta 0:00:01 ------------------------------------ --- 9.2/10.1 MB 5.8 MB/s eta 0:00:01 ------------------------------------- -- 9.4/10.1 MB 5.8 MB/s eta 0:00:01 -------------------------------------- - 9.6/10.1 MB 5.8 MB/s eta 0:00:01 --------------------------------------- 9.8/10.1 MB 5.7 MB/s eta 0:00:01 --------------------------------------- 10.1/10.1 MB 5.7 MB/s eta 0:00:01 ---------------------------------------- 10.1/10.1 MB 5.6 MB/s eta 0:00:00 Downloading docutils-0.21.2-py3-none-any.whl (587 kB) ---------------------------------------- 0.0/587.4 kB ? eta -:--:-- --------------- ------------------------ 225.3/587.4 kB 4.6 MB/s eta 0:00:01 ------------------------------- -------- 460.8/587.4 kB 4.8 MB/s eta 0:00:01 ---------------------------------------- 587.4/587.4 kB 4.6 MB/s eta 0:00:00 Downloading pymdown_extensions-10.8.1-py3-none-any.whl (250 kB) ---------------------------------------- 0.0/250.8 kB ? eta -:--:-- --------------------------------------- 245.8/250.8 kB 5.0 MB/s eta 0:00:01 ---------------------------------------- 250.8/250.8 kB 5.1 MB/s eta 0:00:00 Downloading Markdown-3.6-py3-none-any.whl (105 kB) ---------------------------------------- 0.0/105.4 kB ? eta -:--:-- ---------------------------------------- 105.4/105.4 kB 5.9 MB/s eta 0:00:00 Downloading starlette-0.37.2-py3-none-any.whl (71 kB) ---------------------------------------- 0.0/71.9 kB ? eta -:--:-- ---------------------------------------- 71.9/71.9 kB 3.9 MB/s eta 0:00:00 Downloading tomlkit-0.12.5-py3-none-any.whl (37 kB) Downloading uvicorn-0.29.0-py3-none-any.whl (60 kB) ---------------------------------------- 0.0/60.8 kB ? eta -:--:-- ---------------------------------------- 60.8/60.8 kB 3.2 MB/s eta 0:00:00 Downloading websockets-12.0-cp311-cp311-win_amd64.whl (124 kB) ---------------------------------------- 0.0/125.0 kB ? eta -:--:-- ---------------------------------------- 125.0/125.0 kB 7.2 MB/s eta 0:00:00 Downloading black-24.4.2-cp311-cp311-win_amd64.whl (1.4 MB) ---------------------------------------- 0.0/1.4 MB ? eta -:--:-- -------- ------------------------------- 0.3/1.4 MB 6.3 MB/s eta 0:00:01 ---------------- ----------------------- 0.6/1.4 MB 6.1 MB/s eta 0:00:01 ------------------------ --------------- 0.9/1.4 MB 6.0 MB/s eta 0:00:01 -------------------------------- ------- 1.2/1.4 MB 6.1 MB/s eta 0:00:01 --------------------------------------- 1.4/1.4 MB 6.4 MB/s eta 0:00:01 ---------------------------------------- 1.4/1.4 MB 6.0 MB/s eta 0:00:00 Downloading mypy_extensions-1.0.0-py3-none-any.whl (4.7 kB) Downloading pathspec-0.12.1-py3-none-any.whl (31 kB) Installing collected packages: websockets, tomlkit, pathspec, mypy-extensions, markdown, docutils, uvicorn, starlette, pymdown-extensions, black, marimo Attempting uninstall: markdown Found existing installation: Markdown 3.5.1 Uninstalling Markdown-3.5.1: Successfully uninstalled Markdown-3.5.1 Successfully installed black-24.4.2 docutils-0.21.2 marimo-0.5.2 markdown-3.6 mypy-extensions-1.0.0 pathspec-0.12.1 pymdown-extensions-10.8.1 starlette-0.37.2 tomlkit-0.12.5 uvicorn-0.29.0 websockets-12.0
# Load the app and data from the first version in the set for comparison
A1 = use ("saulocantanhede/tfgreek2", version="0.5.7")
Locating corpus resources ...
The requested app is not available offline ~/text-fabric-data/github/saulocantanhede/tfgreek2/app not found
| 0.56s T otype from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 6.64s T oslots from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 0.00s T before from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 1.16s T lemma from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 1.00s T punctuation from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 0.46s T verse from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 1.11s T lemmatranslit from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 1.03s T after from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 1.15s T translit from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 1.22s T text from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 0.47s T chapter from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 1.21s T unaccent from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 0.99s T book from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | | 0.16s C __levels__ from otype, oslots, otext | | 3.69s C __order__ from otype, oslots, __levels__ | | 0.15s C __rank__ from otype, __order__ | | 12s C __levUp__ from otype, oslots, __rank__ | | 6.63s C __levDown__ from otype, __levUp__, __rank__ | | 0.34s C __characters__ from otext | | 2.24s C __boundary__ from otype, oslots, __rank__ | | 0.04s C __sections__ from otype, oslots, otext, __levUp__, __levels__, book, chapter, verse | 0.02s T appositioncontainer from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 0.21s T articular from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 0.96s T bookshort from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 0.66s T case from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 0.05s T clausetype from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 1.59s T cls from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 0.03s T cltype from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 0.00s T criticalsign from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 0.05s T crule from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 0.01s T degree from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 0.05s T discontinuous from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 0.99s T domain from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 0.37s T frame from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 0.27s T framespec from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 0.72s T function from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 0.61s T gender from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 1.19s T gloss from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 1.36s T id from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 0.17s T junction from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 0.00s T lang from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 1.13s T ln from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 0.27s T mood from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 1.14s T morph from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 0.05s T nodeid from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 1.26s T normalized from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 0.00s T note from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 1.70s T num from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 1.05s T number from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 2.91s T parent from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 0.21s T person from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 1.40s T ref from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 0.15s T referent from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 0.01s T rela from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 0.66s T role from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 0.78s T rule from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 29s T sibling from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 1.06s T sp from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 0.97s T strong from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 0.11s T subjref from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7 | 0.18s T subjrefspec from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.7
--------------------------------------------------------------------------- KeyboardInterrupt Traceback (most recent call last) Cell In[68], line 2 1 # Load the app and data from the first version in the set for comparison ----> 2 A1 = use ("saulocantanhede/tfgreek2", version="0.5.7") File ~\anaconda3\envs\Text-Fabric\Lib\site-packages\tf\app.py:56, in use(appName, backend, *args, **kwargs) 23 """Make use of a corpus. 24 25 For a detailed description, see `tf.about.usefunc`. (...) 51 tf.advanced.app.App 52 """ 54 (appName, checkoutApp, dataLoc, backend) = useApp(appName, backend) ---> 56 return findApp(appName, checkoutApp, dataLoc, backend, False, *args, **kwargs) File ~\anaconda3\envs\Text-Fabric\Lib\site-packages\tf\advanced\app.py:630, in findApp(appName, checkoutApp, dataLoc, backend, _browse, silent, version, legacy, *args, **kwargs) 628 kwargs["mod"] = mod 629 try: --> 630 app = appClass( 631 cfg, 632 appName, 633 appPath, 634 commit, 635 release, 636 local, 637 backend, 638 _browse, 639 *args, 640 version=version, 641 versionOverride=not not versionGiven, 642 silent=silent, 643 **kwargs, 644 ) 645 except Exception as e: 646 if appClass is not App: File C:/Users/tonyj/text-fabric-data/github/saulocantanhede/tfgreek2/app/app.py:60, in TfApp.__init__(app, *args, **kwargs) 59 def __init__(app, *args, **kwargs): ---> 60 super().__init__(*args, **kwargs) 61 app.viewtype('syntax') #default option as syntax view 62 app.dm('See [here](https://github.com/saulocantanhede/tfgreek2/blob/main/docs/viewtypes.md#start) for more information on viewtypes') File ~\anaconda3\envs\Text-Fabric\Lib\site-packages\tf\advanced\app.py:190, in App.__init__(self, cfg, appName, appPath, commit, release, local, backend, _browse, hoist, version, versionOverride, checkout, mod, locations, modules, volume, collection, api, setFile, silent, loadData, _withGc, **configOverrides) 184 loadableFeatures = allFeatures["nodes"] + allFeatures["edges"] 185 useFeatures = [ 186 f 187 for f in loadableFeatures 188 if f not in excludedFeatures and not f.startswith(OMAP) 189 ] --> 190 result = TF.load(useFeatures, add=True, silent=silent) 191 if result is False: 192 self.api = None File ~\anaconda3\envs\Text-Fabric\Lib\site-packages\tf\core\fabric.py:414, in FabricCore.load(self, features, add, silent) 412 reset() 413 for fName in self.featuresRequested: --> 414 self._loadFeature(fName) 415 if not self.good: 416 indent(level=0) File ~\anaconda3\envs\Text-Fabric\Lib\site-packages\tf\core\fabric.py:801, in FabricCore._loadFeature(self, fName, optional) 799 self.good = False 800 else: --> 801 if not self.features[fName].load(silent=silent, _withGc=self._withGc): 802 self.good = False File ~\anaconda3\envs\Text-Fabric\Lib\site-packages\tf\core\data.py:145, in Data.load(self, metaOnly, silent, _withGc) 143 actionRep = "M" 144 else: --> 145 self._writeDataBin() 146 else: 147 actionRep = "B" File ~\anaconda3\envs\Text-Fabric\Lib\site-packages\tf\core\data.py:690, in Data._writeDataBin(self) 687 try: 688 with gzip.open(self.binPath, mode="wb", compresslevel=GZIP_LEVEL) as f: 689 # pickle.dump(self.data, f, protocol=PICKLE_PROTOCOL) --> 690 f.write(optimize(pickle.dumps(self.data, protocol=PICKLE_PROTOCOL))) 691 except Exception as e: 692 error(f'Cannot write to file "{self.binPath}" because: {str(e)}') File ~\anaconda3\envs\Text-Fabric\Lib\gzip.py:289, in GzipFile.write(self, data) 286 length = data.nbytes 288 if length > 0: --> 289 self.fileobj.write(self.compress.compress(data)) 290 self.size += length 291 self.crc = zlib.crc32(data, self.crc) KeyboardInterrupt:
# Load the app and data from the second version in the set for comparison
A2 = use ("saulocantanhede/tfgreek2", version="0.5.6")
Locating corpus resources ...
The requested app is not available offline ~/text-fabric-data/github/saulocantanhede/tfgreek2/app not found
The requested data is not available offline ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 not found rate limit is 5000 requests per hour, with 4999 left for this hour connecting to online GitHub repo saulocantanhede/tfgreek2 ... connected tf/0.5.6/after.tf...downloaded tf/0.5.6/appositioncontainer.tf...downloaded tf/0.5.6/articular.tf...downloaded tf/0.5.6/before.tf...downloaded tf/0.5.6/book.tf...downloaded tf/0.5.6/bookshort.tf...downloaded tf/0.5.6/case.tf...downloaded tf/0.5.6/chapter.tf...downloaded tf/0.5.6/clausetype.tf...downloaded tf/0.5.6/cls.tf...downloaded tf/0.5.6/cltype.tf...downloaded tf/0.5.6/criticalsign.tf...downloaded tf/0.5.6/crule.tf...downloaded tf/0.5.6/degree.tf...downloaded tf/0.5.6/discontinuous.tf...downloaded tf/0.5.6/domain.tf...downloaded tf/0.5.6/frame.tf...downloaded tf/0.5.6/framespec.tf...downloaded tf/0.5.6/function.tf...downloaded tf/0.5.6/gender.tf...downloaded tf/0.5.6/gloss.tf...downloaded tf/0.5.6/id.tf...downloaded tf/0.5.6/junction.tf...downloaded tf/0.5.6/lang.tf...downloaded tf/0.5.6/lemma.tf...downloaded tf/0.5.6/lextranslit.tf...downloaded tf/0.5.6/ln.tf...downloaded tf/0.5.6/mood.tf...downloaded tf/0.5.6/morph.tf...downloaded tf/0.5.6/nodeid.tf...downloaded tf/0.5.6/normalized.tf...downloaded tf/0.5.6/note.tf...downloaded tf/0.5.6/num.tf...downloaded tf/0.5.6/number.tf...downloaded tf/0.5.6/oslots.tf...downloaded tf/0.5.6/otext.tf...downloaded tf/0.5.6/otype.tf...downloaded tf/0.5.6/parent.tf...downloaded tf/0.5.6/person.tf...downloaded tf/0.5.6/punctuation.tf...downloaded tf/0.5.6/ref.tf...downloaded tf/0.5.6/referent.tf...downloaded tf/0.5.6/rela.tf...downloaded tf/0.5.6/role.tf...downloaded tf/0.5.6/rule.tf...downloaded tf/0.5.6/sibling.zip...downloaded tf/0.5.6/strong.tf...downloaded tf/0.5.6/subjref.tf...downloaded tf/0.5.6/subjrefspec.tf...downloaded tf/0.5.6/tense.tf...downloaded tf/0.5.6/text.tf...downloaded tf/0.5.6/trans.tf...downloaded tf/0.5.6/translit.tf...downloaded tf/0.5.6/typ.tf...downloaded tf/0.5.6/type.tf...downloaded tf/0.5.6/unaccent.tf...downloaded tf/0.5.6/unicode.tf...downloaded tf/0.5.6/variant.tf...downloaded tf/0.5.6/verse.tf...downloaded tf/0.5.6/voice.tf...downloaded OK
| 0.58s T otype from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 6.26s T oslots from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 0.00s T before from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 1.18s T lemma from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 1.03s T punctuation from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 0.47s T verse from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 1.04s T after from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 1.18s T translit from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 1.26s T text from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 0.54s T chapter from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 1.19s T lextranslit from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 1.28s T unaccent from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 1.03s T book from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | | 0.17s C __levels__ from otype, oslots, otext | | 4.28s C __order__ from otype, oslots, __levels__ | | 0.14s C __rank__ from otype, __order__ | | 12s C __levUp__ from otype, oslots, __rank__ | | 6.64s C __levDown__ from otype, __levUp__, __rank__ | | 0.34s C __characters__ from otext | | 1.83s C __boundary__ from otype, oslots, __rank__ | | 0.04s C __sections__ from otype, oslots, otext, __levUp__, __levels__, book, chapter, verse | 0.02s T appositioncontainer from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 0.21s T articular from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 0.98s T bookshort from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 0.68s T case from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 0.05s T clausetype from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 1.63s T cls from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 0.03s T cltype from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 0.00s T criticalsign from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 0.06s T crule from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 0.01s T degree from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 0.05s T discontinuous from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 1.12s T domain from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 0.37s T frame from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 0.29s T framespec from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 0.75s T function from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 0.60s T gender from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 0.56s T gloss from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 1.33s T id from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 0.15s T junction from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 0.00s T lang from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 1.10s T ln from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 0.25s T mood from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 1.08s T morph from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 0.05s T nodeid from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 1.22s T normalized from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 0.00s T note from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 1.65s T num from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 0.81s T number from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 3.17s T parent from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 0.18s T person from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 1.33s T ref from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 0.15s T referent from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 0.01s T rela from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 0.68s T role from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 0.82s T rule from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 0.96s T strong from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 0.10s T subjref from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 0.18s T subjrefspec from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 0.25s T tense from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 1.17s T trans from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 0.42s T typ from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 0.94s T type from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 1.25s T unicode from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 0.00s T variant from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6 | 0.25s T voice from ~/text-fabric-data/github/saulocantanhede/tfgreek2/tf/0.5.6
Name | # of nodes | # slots / node | % coverage |
---|---|---|---|
book | 27 | 5102.93 | 100 |
chapter | 260 | 529.92 | 100 |
verse | 7944 | 17.34 | 100 |
sentence | 19767 | 13.79 | 198 |
group | 8964 | 7.02 | 46 |
clause | 30479 | 7.19 | 159 |
wg | 106868 | 6.88 | 533 |
phrase | 69403 | 1.91 | 96 |
subphrase | 116034 | 1.60 | 135 |
word | 137779 | 1.00 | 100 |
3
saulocantanhede/tfgreek2
C:/Users/tonyj/text-fabric-data/github/saulocantanhede/tfgreek2/app
''
[]
none
unknown
NA
:
text-orig-full
https://github.com/saulocantanhede/tfgreek2/tree/main/docs
about
https://github.com/saulocantanhede/tfgreek2
https://github.com/saulocantanhede/tfgreek2/tree/main/docs/features/<feature>.md
README
text-orig-full
}True
C:/Users/tonyj/text-fabric-data/github/saulocantanhede/tfgreek2/_temp
main
Nestle 1904 Greek New Testament
10.5281/zenodo.notyet
[]
saulocantanhede
/tf
tfgreek2
tfgreek2
0.5.6
https://learner.bible/text/show_text/nestle1904/
Show this on the website
en
https://learner.bible/text/show_text/nestle1904/<1>/<2>/<3>
{webBase}/word?version={version}&id=<lid>
True
{typ} {function} {rela} \\ {cls} {role} {junction}
''
{typ} {function} {rela} \\ {type} {role} {rule}
''
True
{typ} {function} {rela} \\ {type} {role} {rule}
''
{typ} {function} {rela} \\ {role} {rule}
''
{typ} {function} {rela} \\ {type} {role} {rule}
''
True
{book} {chapter}:{verse}
''
True
{type} {role} {rule} {junction}
''
lemma
sp
gloss
]grc
App config error(s) in word: features: feature sp not loaded
Display is setup for viewtype syntax-view
See here for more information on viewtypes
A2.zipAll()
Data to be zipped:
fatal: not a git repository (or any of the parent directories): .git
OK app (v?? ??) : ~/github/saulocantanhede/tfgreek2/app
fatal: not a git repository (or any of the parent directories): .git
OK main data (v?? ??) : ~/github/saulocantanhede/tfgreek2/tf/0.5.6 Writing zip file ...
'~/Downloads/github/saulocantanhede/tfgreek2/complete.zip'
from tf.advanced.helpers import dm
from tf.advanced.repo import checkoutRepo
def do(task):
md = f"""
commit | release | local | base | subdir
--- | --- | --- | --- | ---
`{task[0]}` | `{task[1]}` | `{task[2]}` | `{task[3]}` | `{task[4]}`
"""
dm(md)
do(checkoutRepo(backend='github', org="saulocantanhede", repo="tfgreek2", folder="tf", version="0.5.6", checkout=""))
commit | release | local | base | subdir |
---|---|---|---|---|
77a9118c7cd97145e8b6d32d23cbf227b3d70727 |
0.5.6 |
local |
C:/Users/tonyj/text-fabric-data/github |
saulocantanhede/tfgreek2/tf |
do(checkoutRepo(backend='github', org="saulocantanhede", repo="tfgreek2", folder="tf", version="0.5.7", checkout=""))
commit | release | local | base | subdir |
---|---|---|---|---|
352af50c8ce86edd8a0e2d58519453a8f53ee084 |
None |
local |
C:/Users/tonyj/text-fabric-data/github |
saulocantanhede/tfgreek2/tf |
# The version number of the script
scriptVersion="0.1"
scriptDate="May. 12, 2024"
The following will create a dictionary containing all relevant information for the loaded node and edge features.
# Initialize an empty dictionary to store feature data
featureDict = {}
import time
overallTime = time.time()
def getFeatureDescription(metaData):
"""
This function looks for the 'description' key in the metadata dictionary. If the key is found,
it returns the corresponding description. If the key is not present, it returns a default
message indicating that no description is available.
Parameters:
metaData (dict): A dictionary containing metadata about a feature.
Returns:
str: The description of the feature if available, otherwise a default message.
"""
return metaData.get('description', "No feature description")
def setDataType(metaData):
"""
This function checks for the 'valueType' key in the metadata. If the key is present, it
returns 'String' if the value is 'str', and 'Integer' for other types. If the 'valueType' key
is not present, it returns 'Unknown'.
Parameters:
metaData (dict): A dictionary containing metadata, including the 'valueType' of a feature.
Returns:
str: A string indicating the determined data type ('String', 'Integer', or 'Unknown').
"""
if 'valueType' in metaData:
return "String" if metaData["valueType"] == 'str' else "Integer"
return "Unknown"
def processFeature(feature, featureType, featureMethod):
"""
Processes a given feature by extracting metadata, description, and data type, and then
compiles frequency data for different node types in a feature dictionary. Certain features
are skipped based on their type. The processed data is added to a global feature dictionary.
Parameters:
feature (str): The name of the feature to be processed.
featureType (str): The type of the feature ('Node' or 'Edge').
featureMethod (function): A function to obtain feature data.
Returns:
None: The function updates a global dictionary with processed feature data and does not return anything.
"""
# Obtain the meta data
featureMetaData = featureMethod(feature).meta
featureDescription = getFeatureDescription(featureMetaData)
dataType = setDataType(featureMetaData)
# Initialize dictionary to store feature frequency data
featureFrequencyDict = {}
# Skip for specific features based on type
if not (featureType == 'Node' and feature == 'otype') and not (featureType == 'Edge' and feature == 'oslots'):
for nodeType in F.otype.all:
frequencyLists = featureMethod(feature).freqList(nodeType)
if not isinstance(frequencyLists, int):
if len(frequencyLists)!=0:
featureFrequencyDict[nodeType] = {'nodetype': nodeType, 'freq': frequencyLists[:tableLimit]}
elif isinstance(frequencyLists, int):
if frequencyLists != 0:
featureFrequencyDict[nodeType] = {'nodetype': nodeType, 'freq': [("Link", frequencyLists)]}
# Add processed feature data to the main dictionary
featureDict[feature] = {'name': feature, 'descr': featureDescription, 'type': featureType, 'datatype': dataType, 'freqlist': featureFrequencyDict}
########################################################
# MAIN FUNCTION #
########################################################
########################################################
# Gather general information #
########################################################
print('Gathering generic details')
# Initialize default values
corpusName = A.appName
liveName = ''
versionName = A.version
# Trying to locate corpus information
if A.provenance:
for parts in A.provenance[0]:
if isinstance(parts, tuple):
key, value = parts[0], parts[1]
if verbose: print (f'General info: {key}={value}')
if key == 'corpus': corpusName = value
if key == 'version': versionName = value
# value for live is a tuple
if key == 'live': liveName=value[1]
if liveName is not None and len(liveName)>1:
# an URL was found
pageTitleMD = f'Doc4TF pages for [{corpusName}]({liveName}) (version {versionName})'
pageTitleHTML = f'<h1>Doc4TF pages for <a href="{liveName}">{corpusName}</a> (version {versionName})</h1>'
else:
# No URL found
pageTitleMD = f'Doc4TF pages for {corpusName} (version {versionName})'
pageTitleHTML = f'<h1>Doc4TF pages for {corpusName} (version {versionName})</h1>'
# Overwrite in case user provided a title
if 'customPageTitleMD_' in globals():
pageTitleMD = customPageTitleMD
if 'customPageTitleHTML' in globals():
pageTitleMD = customPageTitleHTML
########################################################
# Processing node features #
########################################################
print('Analyzing Node Features: ', end='')
for nodeFeature in Fall():
if not verbose: print('.', end='') # Progress indicator
processFeature(nodeFeature, 'Node', Fs)
if verbose: print(f'\nFeature {nodeFeature} = {featureDict[nodeFeature]}\n') # Print feature data if verbose
########################################################
# Processing edge features #
########################################################
print('\nAnalyzing Edge Features: ', end='')
for edgeFeature in Eall():
if not verbose: print('.', end='') # Progress indicator
processFeature(edgeFeature, 'Edge', Es)
if verbose: print(f'\nFeature {edgeFeature} = {featureDict[edgeFeature]}\n') # Print feature data if verbose
print(f'\nFinished in {time.time() - overallTime:.2f} seconds.')
Gathering generic details Analyzing Node Features: .................................................. Analyzing Edge Features: .... Finished in 12.62 seconds.
Licenced under Creative Commons Attribution 4.0 International (CC BY 4.0)