Giter Club home page Giter Club logo

kanjivg-tools's Introduction

KanjiVG Tools

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

Building

Requirements:

  • JDK 1.8+ (tested with Oracle JDK)
  • (optional) Gradle 2.13+ - project includes Gradle wrapper scripts (gradlew and gradlew.bat), you can just use those

Running

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 *.svg files from KanjiVG project
  • -Dlog.level=WARN (optional) - set logging level:
    • DEBUG - most verbose, reports everything
    • INFO - reports progress, parsing/validation errors and application errors
    • WARN (default) - reports parsing/validation errors and application errors
    • ERROR least verbose, reports only application errors
  • -Dtask=validate (optional) - task to run:
    • validate (default) - parse and validate files
    • repair_ids - fix invalid id attributes on all tags

validate task arguments:

  • -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 file 01a2b.svg
    • -Dvalidate.files.included=01a2b* - matches 01a2b.svg, 01a2b-Kaisho.svg, etc.
    • -Dvalidate.files.included=01a2b,03c4d,05e6f - matches 01a2b.svg, 03c4d.svg, 05e6f.svg
  • -Dvalidate.files.excluded - similar to previous, but for exclusions, null by 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:
      • WidthAndHeight
      • ViewBox
      • StrokeRootGroupId
      • StrokeRootGroupStyle
      • StrokeGroupsIds
      • StrokeIds
      • NumberRootGroupId
      • NumberRootGroupStyle
      • StrokeNumbersCount
      • NumberOrder
      • NumberPositions
      • (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

repair_ids task arguments:

  • -Drepair_ids.files.included=* - same as in the validate task
  • -Drepair_ids.files.excluded=* - same as in the validate task

License

This work is licensed under a Creative Commons Attribution 4.0 International License.

Creative Commons Attribution 4.0 International License

kanjivg-tools's People

Contributors

scriptin avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.