Skip to content
Snippets Groups Projects
Commit 2954c0ac authored by ilor's avatar ilor
Browse files

figured out a better way to handle chunks in cclwriter, should be better now

parent a20fbd21
Branches
No related merge requests found
......@@ -21,6 +21,15 @@ CclWriter::~CclWriter()
}
void CclWriter::write_sentence(const Sentence& s)
{
paragraph_head();
if (use_indent_) indent_more();
write_sentence_int(s);
if (use_indent_) indent_less();
osi() << "</chunk>\n";
}
void CclWriter::write_sentence_int(const Sentence &s)
{
const AnnotatedSentence* ann = dynamic_cast<const AnnotatedSentence*>(&s);
osi() << "<sentence>\n";
......@@ -46,8 +55,7 @@ void CclWriter::write_sentence(const Sentence& s)
XmlWriter::write_token(*t);
}
}
if (use_indent_) indent_less();
osi() << "</sentence>\n";
if (use_indent_) indent_less(); osi() << "</sentence>\n";
}
void CclWriter::write_chunk(const Chunk &c)
......@@ -55,7 +63,7 @@ void CclWriter::write_chunk(const Chunk &c)
paragraph_head(c);
if (use_indent_) indent_more();
foreach (const Sentence::ConstPtr& s, c.sentences()) {
write_sentence(*s);
write_sentence_int(*s);
}
if (use_indent_) indent_less();
osi() << "</chunk>\n";
......
......@@ -20,6 +20,8 @@ public:
static bool registered;
protected:
void write_sentence_int(const Sentence &s);
void do_header();
void do_footer();
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment