diff --git a/tests.py b/tests.py index cd0a3dfbc..626772275 100644 --- a/tests.py +++ b/tests.py @@ -8679,6 +8679,13 @@ def _test_uninvert2(): print('uninverted: ' + uninverted_text) assert uninverted_text == 'This is a test.' + inverted_text = 'uspol' + uninverted_text = uninvert_text(inverted_text) + if uninverted_text != 'uspol': + print('inverted: ' + inverted_text) + print('uninverted: ' + uninverted_text) + assert uninverted_text == 'uspol' + def _test_check_individual_post_content(): print('check_individual_post_content') diff --git a/utils.py b/utils.py index 74498a797..f21265934 100644 --- a/utils.py +++ b/utils.py @@ -225,7 +225,7 @@ def uninvert_text(text: str) -> str: possible_result = ch_result + possible_result result = text - if matches > len(text)/3: + if matches > len(text)/2: result = possible_result new_result = '' extra_replace = {