PageValidator: test "lax"
@@ -19,6 +19,13 @@ class TestPageValidator(TestCase):
report = PageValidator.validate_ocrd_file(ocrd_file)
self.assertEqual(len(report.errors), 17, 'errors')
+ def test_validate_lax(self):
+ resolver = Resolver()
+ workspace = resolver.workspace_from_url(assets.url_of('kant_aufklaerung_1784/data/mets.xml'))
+ ocrd_file = workspace.mets.find_files(ID="PAGE_0020_PAGE")[0]
+ self.assertEqual(len(PageValidator.validate_ocrd_file(ocrd_file).errors), 25, '25 errors - strict')
+ self.assertEqual(len(PageValidator.validate_ocrd_file(ocrd_file, strictness='lax').errors), 0, 'no errors - lax')
+
def test_fix(self):
page = parse(assets.path_to('glyph-consistency/data/OCR-D-GT-PAGE/FAULTY_GLYPHS'), silence=True)
report = PageValidator.validate_ocrd_page(page)
