Merge pull request #4150 from tfmorris/4149-directory-to-stdout

Send output of combine_tessdata -d to stdout instead of stderr. Fixes #4149
This commit is contained in:
zdenop 2023-10-24 06:57:38 +02:00 committed by GitHub
commit eb612f0786
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -211,11 +211,11 @@ void TessdataManager::Clear() {
// Prints a directory of contents.
void TessdataManager::Directory() const {
tprintf("Version:%s\n", VersionString().c_str());
printf("Version:%s\n", VersionString().c_str());
auto offset = TESSDATA_NUM_ENTRIES * sizeof(int64_t);
for (unsigned i = 0; i < TESSDATA_NUM_ENTRIES; ++i) {
if (!entries_[i].empty()) {
tprintf("%u:%s:size=%zu, offset=%zu\n", i, kTessdataFileSuffixes[i], entries_[i].size(),
printf("%u:%s:size=%zu, offset=%zu\n", i, kTessdataFileSuffixes[i], entries_[i].size(),
offset);
offset += entries_[i].size();
}

View File

@ -265,6 +265,9 @@ int main(int argc, char **argv) {
"Usage for listing directory of components:\n"
" %s -d traineddata_file\n\n",
argv[0]);
printf(
"NOTE: Above two flags may combined as -dl or -ld to get both outputs"
);
printf(
"Usage for compacting LSTM component to int:\n"
" %s -c traineddata_file\n",