---
scribo/ChangeLog | 4 ++
scribo/io/xml/save_text_lines.hh | 98 ++++++++++++++++++++------------------
2 files changed, 55 insertions(+), 47 deletions(-)
diff --git a/scribo/ChangeLog b/scribo/ChangeLog
index 53358b7..5dc9919 100644
--- a/scribo/ChangeLog
+++ b/scribo/ChangeLog
@@ -1,5 +1,9 @@
2010-04-13 Guillaume Lazzara <z(a)lrde.epita.fr>
+ * io/xml/save_text_lines.hh: Fix XML output.
+
+2010-04-13 Guillaume Lazzara <z(a)lrde.epita.fr>
+
* debug/decision_image.hh: Add the anchor::Type as argument.
2010-04-13 Guillaume Lazzara <z(a)lrde.epita.fr>
diff --git a/scribo/io/xml/save_text_lines.hh b/scribo/io/xml/save_text_lines.hh
index 22aa3d9..7f0fdf4 100644
--- a/scribo/io/xml/save_text_lines.hh
+++ b/scribo/io/xml/save_text_lines.hh
@@ -84,56 +84,60 @@ namespace scribo
file << "<PcGts
xmlns=\"http://schema.primaresearch.org/PAGE/gts/pagecontent/2009-03-1…
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
xsi:schemaLocation=\"http://schema.primaresearch.org/PAGE/gts/pagecont…
http://schema.primaresearch.org/PAGE/gts/pagecontent/2009-03-16/pagecontent…
pcGtsId=\"" << input_name << "\">" <<
std::endl;
- file << " <Metadata>" << std::endl;
- file << " <Creator>LRDE</pcCreator>" << std::endl;
- file << " <Created/>" << std::endl;
- file << " <LastChange/>" << std::endl;
- file << " <Comments>Generated by Scribo from
Olena.</pcComments>" << std::endl;
- file << " </Metadata>" << std::endl;
-
- file << " <Page image_filename=\"" << input_name
- << "\" image_width=\"" <<
lines.component_set_().labeled_image().ncols()
- << "\" image_height=\"" <<
lines.component_set_().labeled_image().nrows()
+ file << " <PcMetadata>" << std::endl;
+ file << " <PcCreator>LRDE</PcCreator>" <<
std::endl;
+ file << " <PcCreated/>" << std::endl;
+ file << " <PcLastChange/>" << std::endl;
+ file << " <PcComments>Generated by Scribo from
Olena.</PcComments>" << std::endl;
+ file << " </PcMetadata>" << std::endl;
+
+ file << " <page image_filename=\"" << input_name
+ << "\" image_width=\"" <<
lines.components().labeled_image().ncols()
+ << "\" image_height=\"" <<
lines.components().labeled_image().nrows()
<< "\">" << std::endl;
for_all_lines(l, lines)
- {
- file << " <text_region id=\"" << lines(l).id()
- << "\" txt_orientation=\"" <<
lines(l).orientation()
- << "\" txt_reading_orientation=\"" <<
lines(l).reading_orientation()
- << "\" txt_reading_direction=\"" <<
lines(l).reading_direction()
- << "\" txt_reverse_video=\"" <<
(lines(l).reverse_video() ? "true" : "false")
- << "\" txt_indented=\"" << (lines(l).indented() ?
"true" : "false")
- // EXTENSIONS - Not officially supported
- << "\" baseline=\"" << lines(l).baseline()
- << "\" median=\"" << lines(l).median()
- << "\" x_height=\"" << lines(l).x_height()
- << "\" d_height=\"" << lines(l).d_height()
- << "\" a_height=\"" << lines(l).a_height()
- << "\" char_space=\"" << lines(l).char_space()
- << "\" char_width=\"" << lines(l).char_width()
- // End of EXTENSIONS
- << "\">"
- << std::endl;
-
- file << " <coords>" << std::endl
- << " <point x=\"" <<
lines(l).bbox().pmin().row()
- << "\" y=\"" << lines(l).bbox().pmin().col()
<< "\"/>"
- << std::endl
- << " <point x=\"" <<
lines(l).bbox().pmin().row()
- << "\" y=\"" << lines(l).bbox().pmax().col()
<< "\"/>"
- << std::endl
- << " <point x=\"" <<
lines(l).bbox().pmax().row()
- << "\" y=\"" << lines(l).bbox().pmin().col()
<< "\"/>"
- << std::endl
- << " <point x=\"" <<
lines(l).bbox().pmax().row()
- << "\" y=\"" << lines(l).bbox().pmax().col()
<< "\"/>"
- << std::endl
- << " </coords>" << std::endl;
- }
-
- file << " </text_region>" << std::endl;
- file << " </Page>" << std::endl;
+ if (lines(l).tag() != line::Merged
+ && lines(l).tag() != line::Ignored)
+ {
+ file << " <text_region id=\"" << lines(l).id()
+ << "\" txt_orientation=\"" << lines(l).orientation()
+ << "\" txt_reading_orientation=\"" <<
lines(l).reading_orientation()
+ << "\" txt_reading_direction=\"" <<
lines(l).reading_direction()
+ << "\" txt_reverse_video=\"" <<
(lines(l).reverse_video() ? "true" : "false")
+ << "\" txt_indented=\"" << (lines(l).indented() ?
"true" : "false")
+ << "\" kerning=\"" << lines(l).char_space()
+
+ // EXTENSIONS - Not officially supported
+ << "\" baseline=\"" << lines(l).baseline()
+ << "\" meanline=\"" << lines(l).meanline()
+ << "\" x_height=\"" << lines(l).x_height()
+ << "\" d_height=\"" << lines(l).d_height()
+ << "\" a_height=\"" << lines(l).a_height()
+ << "\" char_width=\"" << lines(l).char_width()
+ // End of EXTENSIONS
+ << "\">"
+ << std::endl;
+
+ file << " <coords>" << std::endl
+ << " <point x=\"" <<
lines(l).bbox().pmin().col()
+ << "\" y=\"" << lines(l).bbox().pmin().row() <<
"\"/>"
+ << std::endl
+ << " <point x=\"" <<
lines(l).bbox().pmax().col()
+ << "\" y=\"" << lines(l).bbox().pmin().row() <<
"\"/>"
+ << std::endl
+ << " <point x=\"" <<
lines(l).bbox().pmax().col()
+ << "\" y=\"" << lines(l).bbox().pmax().row() <<
"\"/>"
+ << std::endl
+ << " <point x=\"" <<
lines(l).bbox().pmin().col()
+ << "\" y=\"" << lines(l).bbox().pmax().row() <<
"\"/>"
+ << std::endl
+ << " </coords>" << std::endl;
+
+ file << " </text_region>" << std::endl;
+ }
+
+ file << " </page>" << std::endl;
file << "</PcGts>" << std::endl;
--
1.5.6.5