mirror of https://gitlab.com/bashrc2/epicyon
Stricter check for inverted text
parent
5c01707c97
commit
c5a60176a9
7
tests.py
7
tests.py
|
@ -8679,6 +8679,13 @@ def _test_uninvert2():
|
||||||
print('uninverted: ' + uninverted_text)
|
print('uninverted: ' + uninverted_text)
|
||||||
assert uninverted_text == 'This is a test.'
|
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():
|
def _test_check_individual_post_content():
|
||||||
print('check_individual_post_content')
|
print('check_individual_post_content')
|
||||||
|
|
2
utils.py
2
utils.py
|
@ -225,7 +225,7 @@ def uninvert_text(text: str) -> str:
|
||||||
possible_result = ch_result + possible_result
|
possible_result = ch_result + possible_result
|
||||||
|
|
||||||
result = text
|
result = text
|
||||||
if matches > len(text)/3:
|
if matches > len(text)/2:
|
||||||
result = possible_result
|
result = possible_result
|
||||||
new_result = ''
|
new_result = ''
|
||||||
extra_replace = {
|
extra_replace = {
|
||||||
|
|
Loading…
Reference in New Issue