import os
from tf.convert.xml import XML
#sourceDir= "input_xml"
__file__="C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat"
TEST_SET = set(
"""
26-jude.xml
""".strip().split()
)
AUTHOR = "Evangelists and apostles"
TITLE = "Greek New Testament"
INSTITUTE = "ETCBC (Eep Talstra Centre for Bible and Computer)"
GENERIC = dict(
author=AUTHOR,
title=TITLE,
institute=INSTITUTE,
language="nl",
converters="Dirk Roorda et al. (Text-Fabric)",
sourceFormat="XML (lowfat)",
descriptionTf="Nestle 1904 edition",
)
def transform(text):
return text
X = XML(
sourceVersion="input_xml",
testSet=TEST_SET,
generic=GENERIC,
transform=transform,
tfVersion="0.1",
)
X.run(os.path.basename(__file__))
Working in repository Read_from_lowfat/. in backend my_new_Jupyter_folder Convert XML to TF. There are also commands to check the XML and to load the TF. python3 Read_from_lowfat [tasks/flags] [--help] --help: show this text and exit tasks: a sequence of tasks: check: just reports on the elements in the source. convert: just converts XML to TF load: just loads the generated TF; flags: test: run in test mode Illegal argument `C:/Users/tonyj/AppData/Roaming/jupyter/runtime/kernel-5d0f5aa3-aa03-48e4-b001-990f2d5e42bd.json` Illegal argument `-f`
An exception has occurred, use %tb to see the full traceback. SystemExit: -1
C:\Users\tonyj\anaconda3\lib\site-packages\IPython\core\interactiveshell.py:3377: UserWarning: To exit: use 'exit', 'quit', or Ctrl-D. warn("To exit: use 'exit', 'quit', or Ctrl-D.", stacklevel=1)
%tb
--------------------------------------------------------------------------- SystemExit Traceback (most recent call last) Input In [7], in <cell line: 40>() 29 return text 32 X = XML( 33 sourceVersion="input_xml", 34 testSet=TEST_SET, (...) 37 tfVersion="0.1", 38 ) ---> 40 X.run(os.path.basename(__file__)) File ~\anaconda3\lib\site-packages\tf\convert\xml.py:1026, in XML.run(self, program) 1024 for arg in illegalArgs: 1025 console(f"Illegal argument `{arg}`") -> 1026 sys.exit(-1) 1028 tasks = {arg: True for arg in args if arg in possibleTasks} 1029 flags = {arg: True for arg in args if arg in possibleFlags} SystemExit: -1
! python3 Read_from_lowfat [tasks/flags] [--help]
python3: can't open file 'C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\Read_from_lowfat': [Errno 2] No such file or directory