Skip to content

abbyy to hocr, hocr to text: ERROR Already seen doctype #191

Description

@jbarth-ubhd

example input:

<?xml version="1.0" encoding="UTF-8"?>
<document version="1.0" producer="FineReader 8.0" xmlns="http://www.abbyy.com/FineReader_xml/FineReader8-schema-v2.xml"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://www.abbyy.com/FineReader_xml/FineReader8-schema-v2.xml http://www.abbyy.com/FineReader_xml/FineReader8-schema-v2.xml" languages="">
<page width="1602" height="2540" resolution="300" originalCoords="true">
</page>
</document>

abbyy to hocr (abbyy to page does not work¹) output:

<!DOCTYPE HTML>
<!DOCTYPE HTML><html xmlns="http://www.w3.org/1999/xhtml">
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <title>OCR Output</title>
      <meta name="description" content="OCR Output produced by FineReader 8.0">
   </head>
   <body>
      <div class="ocr_page" title="bbox 0 0 1602 2540"></div>
   </body>
</html>

Please not the duplicate <!doctype ...>

Kind regards, Jochen

Footnote 1)

> ocr-transform abbyy page 0776__758.line.xml asdf.page.xml
Could not load source PAGE XML file: 0776__758.line.xml
org.primaresearch.io.xml.XmlModelAndValidatorProvider$UnsupportedSchemaVersionException: http://www.abbyy.com/FineReader_xml/FineReader8-schema-v2.xml
	at org.primaresearch.io.xml.XmlModelAndValidatorProvider.getValidator(XmlModelAndValidatorProvider.java:197)
	at org.primaresearch.dla.page.io.xml.XmlPageReader.createMainParser(XmlPageReader.java:80)
	at org.primaresearch.dla.page.io.xml.XmlPageReader.parse(XmlPageReader.java:176)
	at org.primaresearch.dla.page.io.xml.XmlPageReader.read(XmlPageReader.java:130)
	at org.primaresearch.dla.page.io.xml.PageXmlInputOutput.readPage(PageXmlInputOutput.java:212)
	at org.primaresearch.dla.page.converter.PageConverter.run(PageConverter.java:230)
	at org.primaresearch.dla.page.converter.PageConverter.main(PageConverter.java:161)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions