diff --git a/generator/ctrl/ctrl_generator.py b/generator/ctrl/ctrl_generator.py index 575724c..80739ae 100644 --- a/generator/ctrl/ctrl_generator.py +++ b/generator/ctrl/ctrl_generator.py @@ -166,8 +166,8 @@ class CTRLGenerator(): return prompt def result_replace(self, result): - # print("\n\nBEFORE RESULT_REPLACE:") - # print(repr(result)) + print("\n\nBEFORE RESULT_REPLACE:") + print(repr(result)) result = cut_trailing_sentence(result) first_letter_capitalized = result[0].isupper() @@ -180,11 +180,9 @@ class CTRLGenerator(): if not first_letter_capitalized: result = result[0].lower() + result[1:] - while("\n \n \n " in result): - result = result.replace("\n \n \n ", "\n \n ") - # print("\n\nAFTER RESULT_REPLACE:") - # print(repr(result)) + print("\n\nAFTER RESULT_REPLACE:") + print(repr(result)) return result @@ -221,7 +219,7 @@ class CTRLGenerator(): "Edit", "&@@", "2:","1:", ":", "Edit@@", "EDI@@", "EDIT@@", "edit", "TL@@", "tl@@", ";@@", '**', "http://@@", "Redd@@", "UP@@", "mom", "Up@@", "Me:", "Update", "mom@@", "Part", "http://www.@@", "edit@@", "*@@", "Writing", "Text@@", "\\@@", "
@@", " 0: @@ -84,6 +85,7 @@ def cut_trailing_sentence(text): def replace_outside_quotes(text, current_word, repl_word): + text = standardize_punctuation(text) reg_expr = re.compile(current_word + '(?=([^"]*"[^"]*")*[^"]*$)') @@ -104,7 +106,7 @@ def mapping_variation_pairs(mapping): # Change you it's before a punctuation if mapping[0] is "you": mapping = ("you", "me") - mapping_list.append((" " + mapping[0]+"\,", " " + mapping[1]+",")) + mapping_list.append((" " + mapping[0]+",", " " + mapping[1]+",")) mapping_list.append((" " + mapping[0]+"\?", " " + mapping[1]+"\?")) mapping_list.append((" " + mapping[0]+"\!", " " + mapping[1]+"\!")) mapping_list.append((" " + mapping[0] + "\.", " " + mapping[1] + "."))