This project is a set of tools for KanjiVG data. (See KanjiVG GitHub repo for data and issues.)
It consists of:
- Parser for SVG files from KanjiVG
- Various validations of those SVG files
- Transformation and fixing utilities for SVG files
Requirements:
- JDK 1.8+ (tested with Oracle JDK)
- (optional) Gradle 2.13+ - project includes Gradle wrapper scripts (
gradlewandgradlew.bat), you can just use those
On Mac and Linux:
./gradlew clean run -DkanjivgDir=/abs/path/to/kanjivg/kanji
On Windows:
gradlew.bat clean run -DkanjivgDir=/abs/path/to/kanjivg/kanji
Arguments:
-Dkanjivg.dir=/abs/path/to/kanjivg/kanji(required) - set absolute path to a directory with*.svgfiles from KanjiVG project-Dlog.level=WARN(optional) - set logging level:DEBUG- most verbose, reports everythingINFO- reports progress, parsing/validation errors and application errorsWARN(default) - reports parsing/validation errors and application errorsERRORleast verbose, reports only application errors
-Dtask=validate(optional) - task to run:validate(default) - parse and validate filesrepair_ids- fix invalididattributes on all tags
-Dvalidate.files.included=*- list of glob-like patterns to filter files by their names w/o '.svg' extension, where*denotes any number of any characters Examples:-Dvalidate.files.included=*(default) - matches all files-Dvalidate.files.included=01a2b- matches a single file01a2b.svg-Dvalidate.files.included=01a2b*- matches01a2b.svg,01a2b-Kaisho.svg, etc.-Dvalidate.files.included=01a2b,03c4d,05e6f- matches01a2b.svg,03c4d.svg,05e6f.svg
-Dvalidate.files.excluded- similar to previous, but for exclusions,nullby default. Exclusions are applied after inclusions-Dvalidations.enabled=all- enabled validations:all(default) - all available validations- comma-separated list of case-sensitive names of validations from
org.kanjivg.tools.validation package:
WidthAndHeightViewBoxStrokeRootGroupIdStrokeRootGroupStyleStrokeGroupsIdsStrokeIdsNumberRootGroupIdNumberRootGroupStyleStrokeNumbersCountNumberOrderNumberPositions- (this list may be outdated, please refer to the source code)
Parameters of validations:
Dvalidations.NumberPositions.maxDistance=25.0- max. allowed distance b/w stroke starting point and corresponding stroke number
-Drepair_ids.files.included=*- same as in thevalidatetask-Drepair_ids.files.excluded=*- same as in thevalidatetask
This work is licensed under a Creative Commons Attribution 4.0 International License.
