fix(ocr): checking the abnormal post correction feature added #264
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We have noticed that our post correction of character order bit strict in some case hence resulting in very unexpected output. This PR has one function added to check the abnormal postcorrection and a flag in ocr formatter object also in order to go through the checking. If the checking of postcorrection flag is true and the function find abnormality in the post correction, it would use the original line and character order given by google ocr output else it will use the post corrected one. The google vision formatter's checking postcorrection flag is by default false. Hence it will use the postcorrected order by default. The function checking the postcorrection is here.