-
Notifications
You must be signed in to change notification settings - Fork 9.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix code for generating config files #4074
base: main
Are you sure you want to change the base?
Conversation
Can you please add it also to C-API? |
I added corresponding functions to the C API. |
Do we really need any new API function not only for C++ but also for C? |
Why C and C++ API should not be synchronized (providing the same features)? |
Each additional API creates some costs (implementation, maintenance, code size). And is there still a need for a C API? Maybe we should even consider dropping the whole C API in a future version 6. If a C API for a new function is really missing it can be added any time later. |
IMO costs are minimal for CAPI. I see no benefit in removing it. |
What about keeping the API unchanged, but fixing the API regression (introduced in commit c51691f)?
That is my preferred solution because I try to minimize API changes. |
@Balearica, if you want to update your pull request with a new implementation which avoids API changes, it would be nice if you could review your author information. Many projects refuse pull requests without a valid real name for the author, and I think that would be good for Tesseract contributions, too. |
Resolves #3943, see that issue for a full explanation and previous discussion on this issue.
In short, the function
ParamUtils::PrintParams
previously created a machine-readable config file with parameter names and values. It was then edited to add human-readable descriptions to each of the parameters. While this change undoubtedly made the results easier for users to interpret, the resulting files no longer functioned properly as config files. This (1) broke the parts of the code that assumedParamUtils::PrintParams
created machine-readable config files and (2) meant there was no longer an API function for creating machine-readable config files using the current settings.This PR fixes both issues:
ParamUtils::PrintParams
to specify whether descriptions of parameters should be printedParamUtils::PrintParams
is inarguably being used with the intent of creating a machine-readable config file, the parameter is set totrue
DumpVariables
has been added, which creates config files (the old behavior ofPrintVariables
)