A new test case was added in the 'StringExtensionsTest.cs' to check a scenario where a string does not end with a sentence-ending punctuation. This is essential to ensure the 'HasSentenceEnding()' method handles such scenarios accurately.
This update adds additional test cases in the StringExtensionsTest to ensure sentence ending detection works on italicized strings, both with and without additional HTML font tags. This change will ensure proper sentence ending checks within our text parsing logic.
Previously, only html closing tags (e.g., </i>, </font>) were handled when checking for adjacent sentence-ending characters. This change extends the detection to include assa closing tags (e.g., {\\i0}), improving string manipulation efficiency. This modification will increase the readability and correctness of extracted strings in diverse tag environments."
The culture type evaluation logic was moved to a more suitable location in the code within the StringExtensions file. This change ensures that the culture type is assessed only when it's necessary, avoiding unnecessary operations and leading to optimized performance."
This commit updates the unit tests in StringExtensionsTest.cs to account for more cases of sentence endings. The original tests did not account for edge cases such as having an italic closing tag or an em dash before the end of the sentence which can also signify the end of a sentence. Additionally, corrected an erroneous test that claimed an empty string has a sentence ending, which it doesn't.
This commit changes the index checks in the hyphen and em dash conditions within StringExtensions.cs. Previously, these checks were made at the length (len) of the string value. This could result in inaccurate evaluations, especially for strings with length less than 3 for hyphens and length less than 2 for em dashes. Now, checks are made against 'checkIndex' which should provide more accurate evaluations regardless of the string length."
Changed the return value in the StringExtensions when the string is null or empty. Previously, the function returned true when encountering an empty string which contradicted with its intended behaviour. Now, it correctly returns false when the input string is empty or null, ensuring consistent and reliable usage in future code.
Several FixItem descriptions were updated in the FixCommonErrors.cs source file with clear and specific examples of what each fix does. This will help users understand the changes that are being performed on their subtitles, leading to enhanced usability and a better user experience. This change does not affect functionality, it solely enriches the user interface with more informative text.
Additional unit tests have been added for the HasSentenceEnding method in the StringExtensions class. The tests focus on verifying the method's functionality in both culture-neutral scenarios and specific to Greek culture. This is to ensure reliable string analyses across various usage contexts.
Replaced repetitive 'endingBeforeThis' checks with a new method call 'lastLine.HasSentenceEnding()', improving readability and maintainability. This method encapsulates the logic for checking if the last line has sentence ending punctuation, improving code organization and ensuring consistent behavior.
StringExtensions.cs has been refactored to separate different language sentence ending checks. The previous implementation combined all checks in a single control flow, which was less readable. Now, neutral languages and Greek language have separate check containers. The adjustment also better handles cases when sentence ending character is adjacent with HTML closing tags. This not only improves the readability of the code but also enhances its maintainability.