mirror of
https://gitlab.com/niansa/anyproc.git
synced 2025-03-06 20:49:24 +01:00
Print final unescaped result in translator
This commit is contained in:
parent
1684bebe7c
commit
1f43f4d88b
1 changed files with 5 additions and 2 deletions
|
@ -11,7 +11,10 @@ int main() {
|
|||
return true;
|
||||
};
|
||||
const auto result_printer = [](const char *token) {
|
||||
std::cout << token << std::flush;
|
||||
if (token[0] != '\n')
|
||||
std::cout << token << std::flush;
|
||||
else
|
||||
std::cout << '\r' << std::flush;
|
||||
return true;
|
||||
};
|
||||
|
||||
|
@ -25,7 +28,7 @@ int main() {
|
|||
std::cout << "\rText: " << std::flush;
|
||||
std::getline(std::cin, text);
|
||||
if (text.empty()) break;
|
||||
translator.translate(text, language, progress_indicator, result_printer);
|
||||
std::cout << translator.translate(text, language, progress_indicator, result_printer) << " " << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue