USJ Generation: Implement usfm_parser.to_usj(). AST to USJ conversion. Conversion follows same logic as USX generation does, but not dependent on it.
A simple JSON schema for USJ: Defining the common structure of USJ objects, with valid properties and their type. Not defining what-objects-are-valid-where like in an extensive grammar.
Tests: Older to_dict() had tests for checking successful conversion and check for presence of all markers in output. Both sets passing for new to_usj() as well. Also checking the generated USJ against the above JSON schema.
To List: Re-wrote the older to_list() method which was dependant on the previous JSON output to work with new USJ format.
Code Refactor: Older single file usfm_parser.py which contained USFMParser class and all methods for USX, dict and list generation replaced with 4 files(usx_generator.py, usj_generator.py, list_generator.py), using classes for each of the above, reducing the usfm_parser.py file from 894 to 179 lines of code.
Documentation: Updated details in architecture.md with details in code refactor. Updated Readme.md and the jupyter notebook in docs relpacing old to_dict() with new to_usj()
:warning: This doesn't include implementation of "filter" feature, which was implemented partially in older to_list()
This PR inlcudes
usfm_parser.to_usj()
. AST to USJ conversion. Conversion follows same logic as USX generation does, but not dependent on it.to_dict()
had tests for checking successful conversion and check for presence of all markers in output. Both sets passing for newto_usj()
as well. Also checking the generated USJ against the above JSON schema.to_list()
method which was dependant on the previous JSON output to work with new USJ format.usfm_parser.py
which contained USFMParser class and all methods for USX, dict and list generation replaced with 4 files(usx_generator.py, usj_generator.py, list_generator.py), using classes for each of the above, reducing the usfm_parser.py file from 894 to 179 lines of code.to_dict()
with newto_usj()
:warning: This doesn't include implementation of "filter" feature, which was implemented partially in older
to_list()