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

Commits on Nov 3, 2024

  1. Refactor comma correction logic

    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>
    ivandrofly committed Nov 3, 2024
    Configuration menu
    Copy the full SHA
    4f898ef View commit details
    Browse the repository at this point in the history
  2. Fix comma handling near parentheses and brackets

    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>
    ivandrofly committed Nov 3, 2024
    Configuration menu
    Copy the full SHA
    dedbe0b View commit details
    Browse the repository at this point in the history
  3. Expose NeutralSentenceEndingChars and optimize method in FixCommas

    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>
    ivandrofly committed Nov 3, 2024
    Configuration menu
    Copy the full SHA
    b91a281 View commit details
    Browse the repository at this point in the history