Skip to content
Snippets Groups Projects
Commit 86e57766 authored by Adam Radziszewski's avatar Adam Radziszewski
Browse files

fix spaces in line writer

parent 79f06f02
Branches
No related merge requests found
......@@ -75,19 +75,17 @@ void LineWriter::write_sentence(const Sentence& s)
// use IOB2 representation internally
AnnotationChannel &chan = hax->get_channel(vt.first);
chan.make_iob_from_segments();
IOB::Enum last_tag = IOB::O;
// write line representation
for (int idx = 0; idx < chan.size(); idx++) {
IOB::Enum this_tag = chan.get_iob_at(idx);
if (last_tag == IOB::O || this_tag == IOB::O) {
os() << " ";
if (this_tag == IOB::I) {
os() << chunk_char;
}
else {
os() << chunk_char;
os() << empty_char;
}
last_tag = chan.get_iob_at(idx);
std::string now(" ");
if (last_tag != IOB::O) {
std::string now(empty_char);
if (this_tag != IOB::O) {
if (chan.is_head_at(idx)) {
now = head_char;
}
......@@ -98,7 +96,6 @@ void LineWriter::write_sentence(const Sentence& s)
for (int line_pos = orth_lens[idx]; line_pos > 0; line_pos--) {
os() << now;
}
last_tag = this_tag;
}
os() << "\n";
}
......
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