How rosmord/jseshutils works
Project type and purpose
• This is a set of independent command-line Java utilities (an “open-source tool” category) that leverage the JSesh library to process SVG files.
• Each subdirectory (jsesh-makesvgindex, jsesh-normalizesvg) is a standalone Maven project with a Main class and a comparator utility.
Key components
a. User / CLI
• The end user invokes one of the two JARs from the shell, passing input/output paths and options.
b. jsesh-makesvgindex module
• Main.java – parses arguments, invokes SVG indexing routine.
• GardinerFileOrderComparator – sorts SVG files according to a custom order.
c. jsesh-normalizesvg module
• Main.java – parses arguments, invokes SVG normalization routine.
• GardinerFileOrderComparator – sorts SVG files before normalization.
d. JSesh core library (external dependency)
• Provides APIs to read, manipulate, and write SVG fragments for Egyptian hieroglyphs.
e. File system
• Input directory containing SVG files.
• Output directory where index pages or normalized SVGs are written.
Relationships and data flows
• The User/CLI calls the Main class in one of the modules.
• Main loads file names from the input directory.
• It calls GardinerFileOrderComparator to sort the file list.
• It invokes relevant JSesh library APIs:
• For “makeSVGIndex”, generate an HTML or XML index referencing each SVG.
• For “normalizeSVG”, apply canonical transforms (e.g., flatten transforms, standardize units).
• Results are written back to the file system (output directory).
Architectural patterns & design principles
• Modular, single-responsibility CLI applications: each module has one Main entry point and one core comparator utility.
• Clear separation of concerns:
• Argument parsing and orchestration in Main
• Sorting logic in a dedicated comparator class
• SVG processing in JSesh library
• External dependency is injected at compile time via Maven.
Technologies / frameworks
• Java (source code in src/main/java)
• Maven for build and dependency management (pom.xml in each module)
• JSesh library (declared as a Maven dependency)
• Standard Java I/O for file handling