Mercurial > hgrepos > Python2 > PyMuPDF
comparison mupdf-source/thirdparty/tesseract/src/training/set_unicharset_properties.cpp @ 2:b50eed0cc0ef upstream
ADD: MuPDF v1.26.7: the MuPDF source as downloaded by a default build of PyMuPDF 1.26.4.
The directory name has changed: no version number in the expanded directory now.
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Mon, 15 Sep 2025 11:43:07 +0200 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 1:1d09e1dec1d9 | 2:b50eed0cc0ef |
|---|---|
| 1 // Licensed under the Apache License, Version 2.0 (the "License"); | |
| 2 // you may not use this file except in compliance with the License. | |
| 3 // You may obtain a copy of the License at | |
| 4 // http://www.apache.org/licenses/LICENSE-2.0 | |
| 5 // Unless required by applicable law or agreed to in writing, software | |
| 6 // distributed under the License is distributed on an "AS IS" BASIS, | |
| 7 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 8 // See the License for the specific language governing permissions and | |
| 9 // limitations under the License. | |
| 10 | |
| 11 // This program reads a unicharset file, puts the result in a UNICHARSET | |
| 12 // object, fills it with properties about the unichars it contains and writes | |
| 13 // the result back to a file. | |
| 14 | |
| 15 #include "commandlineflags.h" | |
| 16 #include "commontraining.h" // CheckSharedLibraryVersion | |
| 17 #include "tprintf.h" | |
| 18 #include "unicharset_training_utils.h" | |
| 19 | |
| 20 using namespace tesseract; | |
| 21 | |
| 22 // The directory that is searched for universal script unicharsets. | |
| 23 static STRING_PARAM_FLAG(script_dir, "", "Directory name for input script unicharsets/xheights"); | |
| 24 | |
| 25 int main(int argc, char **argv) { | |
| 26 tesseract::CheckSharedLibraryVersion(); | |
| 27 tesseract::ParseCommandLineFlags(argv[0], &argc, &argv, true); | |
| 28 | |
| 29 // Check validity of input flags. | |
| 30 if (FLAGS_U.empty() || FLAGS_O.empty()) { | |
| 31 tprintf("Specify both input and output unicharsets!\n"); | |
| 32 return EXIT_FAILURE; | |
| 33 } | |
| 34 if (FLAGS_script_dir.empty()) { | |
| 35 tprintf("Must specify a script_dir!\n"); | |
| 36 return EXIT_FAILURE; | |
| 37 } | |
| 38 | |
| 39 tesseract::SetPropertiesForInputFile(FLAGS_script_dir.c_str(), FLAGS_U.c_str(), FLAGS_O.c_str(), | |
| 40 FLAGS_X.c_str()); | |
| 41 return EXIT_SUCCESS; | |
| 42 } |
