Spaces:
Running
Running
fix: style
Browse files- src/dalle_mini/text.py +3 -3
src/dalle_mini/text.py
CHANGED
|
@@ -116,7 +116,7 @@ def remove_comma_numbers(t):
|
|
| 116 |
|
| 117 |
|
| 118 |
def pre_process_dot_numbers(t):
|
| 119 |
-
return re.sub("(\w)\.(\w)",
|
| 120 |
|
| 121 |
|
| 122 |
def post_process_dot_numbers(t):
|
|
@@ -126,7 +126,7 @@ def post_process_dot_numbers(t):
|
|
| 126 |
def pre_process_quotes(t):
|
| 127 |
# allows quotes only for 's, 't, 'd, 'm, 'll, 're, 've
|
| 128 |
return re.sub(
|
| 129 |
-
r"'(?=([stdm]|(ll)|(re)|(ve)|(ll))\b)",
|
| 130 |
)
|
| 131 |
|
| 132 |
|
|
@@ -135,7 +135,7 @@ def post_process_quotes(t):
|
|
| 135 |
|
| 136 |
|
| 137 |
def pre_process_dates(t):
|
| 138 |
-
return re.sub("(\d)/(\d)",
|
| 139 |
|
| 140 |
|
| 141 |
def post_process_dates(t):
|
|
|
|
| 116 |
|
| 117 |
|
| 118 |
def pre_process_dot_numbers(t):
|
| 119 |
+
return re.sub("(\w)\.(\w)", rf"\1{temp_token}dot{temp_token}\2", t)
|
| 120 |
|
| 121 |
|
| 122 |
def post_process_dot_numbers(t):
|
|
|
|
| 126 |
def pre_process_quotes(t):
|
| 127 |
# allows quotes only for 's, 't, 'd, 'm, 'll, 're, 've
|
| 128 |
return re.sub(
|
| 129 |
+
r"'(?=([stdm]|(ll)|(re)|(ve)|(ll))\b)", rf"{temp_token}quote{temp_token}", t
|
| 130 |
)
|
| 131 |
|
| 132 |
|
|
|
|
| 135 |
|
| 136 |
|
| 137 |
def pre_process_dates(t):
|
| 138 |
+
return re.sub("(\d)/(\d)", rf"\1{temp_token}slash{temp_token}\2", t)
|
| 139 |
|
| 140 |
|
| 141 |
def post_process_dates(t):
|