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

Fix/refactor comma correction logic #8972

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ivandrofly
Copy link
Member

No description provided.

Consolidate Arabic comma regex replacements into a lazy-initialized dictionary to enhance maintainability and readability. Simplify redundant regex instantiation by using a loop-based approach. Also, optimize the method for removing extra commas before sentence-ending characters by using a character array.

Signed-off-by: Ivandro Jao <Ivandrofly@gmail.com>
Removed unnecessary checks for opening parentheses and brackets following commas. This prevents inappropriate fixes where commas precede these characters.

Signed-off-by: Ivandro Jao <Ivandrofly@gmail.com>
Make NeutralSentenceEndingChars publicly accessible by changing its access modifier to public. Also, refactor the IsNextCharSentenceClosingSymbol method in FixCommas to utilize the NeutralSentenceEndingChars for more concise and efficient logic.

Signed-off-by: Ivandro Jao <Ivandrofly@gmail.com>
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