commit e67343b1d8843689198db4fd282a4357109a2664 Author: Tanmai Khanna Date: Sun Aug 30 14:22:00 2020 +0530 flush blanks after processRule instead of processOut diff --git a/apertium/interchunk.cc b/apertium/interchunk.cc index c8873b7..0a0f98e 100644 --- a/apertium/interchunk.cc +++ b/apertium/interchunk.cc @@ -422,15 +422,6 @@ Interchunk::processOut(xmlNode *localroot) } } } - - while(!blank_queue.empty()) //flush remaining blanks that are not spaces - { - if(blank_queue.front().compare(" ") != 0) - { - fputws_unlocked(UtfConverter::fromUtf8(blank_queue.front()).c_str(), output); - } - blank_queue.pop(); - } } string @@ -1292,6 +1283,15 @@ Interchunk::processRule(xmlNode *localroot) processInstruction(i); } } + + while(!blank_queue.empty()) //flush remaining blanks that are not spaces + { + if(blank_queue.front().compare(" ") != 0) + { + fputws_unlocked(UtfConverter::fromUtf8(blank_queue.front()).c_str(), output); + } + blank_queue.pop(); + } } TransferToken & diff --git a/apertium/postchunk.cc b/apertium/postchunk.cc index 32ce004..7786eb0 100644 --- a/apertium/postchunk.cc +++ b/apertium/postchunk.cc @@ -665,15 +665,6 @@ Postchunk::processOut(xmlNode *localroot) } } } - - while(!blank_queue.empty()) //flush remaining blanks that are not spaces - { - if(blank_queue.front().compare(" ") != 0) - { - fputws_unlocked(UtfConverter::fromUtf8(blank_queue.front()).c_str(), output); - } - blank_queue.pop(); - } } void @@ -1606,6 +1597,15 @@ Postchunk::processRule(xmlNode *localroot) processInstruction(i); } } + + while(!blank_queue.empty()) //flush remaining blanks that are not spaces + { + if(blank_queue.front().compare(" ") != 0) + { + fputws_unlocked(UtfConverter::fromUtf8(blank_queue.front()).c_str(), output); + } + blank_queue.pop(); + } } TransferToken & diff --git a/apertium/transfer.cc b/apertium/transfer.cc index f20af4b..966a128 100644 --- a/apertium/transfer.cc +++ b/apertium/transfer.cc @@ -880,15 +880,6 @@ Transfer::processOut(xmlNode *localroot) } } } - - while(!blank_queue.empty()) //flush remaining blanks that are not spaces - { - if(blank_queue.front().compare(" ") != 0) - { - fputws_unlocked(UtfConverter::fromUtf8(blank_queue.front()).c_str(), output); - } - blank_queue.pop(); - } } string @@ -2087,6 +2078,16 @@ Transfer::processRule(xmlNode *localroot) } } } + + while(!blank_queue.empty()) //flush remaining blanks that are not spaces + { + if(blank_queue.front().compare(" ") != 0) + { + fputws_unlocked(UtfConverter::fromUtf8(blank_queue.front()).c_str(), output); + } + blank_queue.pop(); + } + return words_to_consume; }