Skip to content
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

Refactor: Consolidate word boundary characters #8987

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ivandrofly
Copy link
Member

Updated the OCR fix engine to use a single constant for word boundary characters. This simplifies the code and improves maintainability by avoiding repetition of the same character set in different places.

Updated the OCR fix engine to use a single constant for word boundary characters. This simplifies the code and improves maintainability by avoiding repetition of the same character set in different places.

Signed-off-by: Ivandro Jao <[email protected]>
for (var i = 0; i < text.Length; i++)
{
if (text[i] != '.' && "\r\n ".Contains(text[i]))
if (wordBoundaryChars.Contains(text[i]))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

text[i] != '.' always true if "\r\n ".Contains(text[i]) is true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant