Fix structure not being read for last text
Change-Id: Id4b7c86312d4a70eccaffd131180c163a1133bb0
diff --git a/script/korapxml2conllu b/script/korapxml2conllu
index b4f673d..dd01ba6 100755
--- a/script/korapxml2conllu
+++ b/script/korapxml2conllu
@@ -301,7 +301,7 @@
s/&/&/go;
tr/…•⋅»«ˮ“”„›‹ʼ‘’‚′‐‑‒–—―⁓⁻₋−﹣-/...""""""'''''''-/;
$plain_texts{$docid} = $_;
- last if($text_count++ > 1 && $plain_texts{$target_id});
+ last if(!$extract_attributes_regex && ($text_count++ > 1 && $plain_texts{$target_id}));
} elsif (m@<text>(.*)@) {
$_= decode("utf-8", $1, Encode::FB_DEFAULT);
s/</</go;
@@ -318,7 +318,7 @@
tr/…•⋅»«ˮ“”„›‹ʼ‘’‚′‐‑‒–—―⁓⁻₋−﹣-/...""""""'''''''-/;
$plain_texts{$docid} .= $_;
$text_started=0;
- last if($text_count++ > 1 && $plain_texts{$target_id});
+ last if(!$extract_attributes_regex && ($text_count++ > 1 && $plain_texts{$target_id}));
} elsif ($text_started) {
chomp;
$_ = decode("utf-8", $_, Encode::FB_DEFAULT) . ' ';