Package: htrvx
HTRVX : HTR Validation for eXtra-quality controlled documentsHTRVX - pronounced Ashterux - allows for quality control of XML using XSD schema validation, Segmonto validation and other verifications.How to installSimply runpip install htrvxHow to runThe basic way to run the script ishtrvx PATHTOFILES --format FORMAT, eg.htrvx ./tests/test_data/page/*.xml --format pageEach verification is an opt-in verification: you need to express the fact that you want to check it.--segmontowill check for Segmonto compliancyYou can use your own vocabulary or a restricted Segmonto vocabulary by using--zone ZONENAMEand--line LINENAMEsuch ashtrvx [...] --line DefaultLine --line HeadingLine --zone MainZoneYou can use--allow-untaggedwith eitherline,zoneorbothso that zones without type are allowed. If you want to limit such lines or zone, combine it with--max-untagged-zones Nor--max-untagged-lines Nwhere N is the number of allowed occurrences.--xsdwill check if the data are compliant with XML Schemas--check-emptywill check if regions have no lines or if lines have no text--check-emptycan be refined with--raise-emptyto throw an error if empty elements are found, otherwise it's simply reported.
=--check-imagechecks for link in the XML. Link are checked relatively to the XML file, ie. if XML file ./data/element.xml points to file.jpeg, file ./data/file.jpeg is expected to exist.Other parameters mainly have to do with verbosity:--verbosedisplays details about errors,--groupgroups errors (instead of showing one line per error, groups by error types).ParametersDefaultFunction-v, --verboseFalsePrints more information-f, --format [alto,page]altoFormat of files-s, --segmontoFalseApply Segmonto Zoning verification-e, --check-emptyFalseCheck for empty lines or empty zones-r, --raise-emptyFalseWarns but not fails if empty lines or empty zones are found-x, --xsdFalseApply XSD Schema verification-g, --groupFalseGroup error types (reduce verbosity)-i, --check-imageFalseCheck if the image link in the XML points to the right path-l, --verbose-levelzenLevel of details and amount of color shown in the logs (seebelow).--zone TEXTNoneProvide a custom zone to control zone types instead of Segmonto--line TEXTNoneProvide a custom line to control Line types instead of SegmontoVerbosity levelsminimal: shows only failing tests, no details.low: shows only failing test and their details, such as which lines fails in a file.zen(default): shows all tests and their details, but displays only one color (red for errors).all: shows everything.Github Action codeIf you want to add this to your github repository, as a continuous integration workflow, add a filehtrux.ymlat in the path.github/workflowsof your repository.# This workflow will install Python dependencies, run tests and lint with a single version of Python# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actionsname:HTRVXon:[push,pull_request]# You can edit this of course !jobs:test:runs-on:ubuntu-lateststeps:-uses:actions/checkout@v2-name:Set up Python 3.8uses:actions/setup-python@v2with:python-version:3.8-name:Install dependenciesrun:|python -m pip install --upgrade pippip install htrvx-name:Run HTRVXrun:|htrvx --verbose --group --format alto --segmonto --xsd --check-empty --raise-empty UNIX/Path/to/**/your/*.xmlLogo byAlix Chagué.