Upload app\routes.py with huggingface_hub
Browse files- app//routes.py +7 -0
app//routes.py
CHANGED
|
@@ -1938,6 +1938,9 @@ def convert_episode_format(content):
|
|
| 1938 |
for line in lines:
|
| 1939 |
converted_line = line
|
| 1940 |
|
|
|
|
|
|
|
|
|
|
| 1941 |
# @μ«μν ν¨ν΄ (곡백 ν¬ν¨/λ―Έν¬ν¨)
|
| 1942 |
converted_line = re.sub(r'^@\s*(\d+)\s*ν\s*', r'#\1ν', converted_line)
|
| 1943 |
|
|
@@ -1950,6 +1953,10 @@ def convert_episode_format(content):
|
|
| 1950 |
# μ€ μμμμ μ«μλ‘ μμνκ³ λ°λ‘ "ν"κ° μ€λ κ²½μ°
|
| 1951 |
if not re.search(r'^#\d+ν', converted_line):
|
| 1952 |
converted_line = re.sub(r'^(\d+)\s*ν\s*', r'#\1ν', converted_line)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1953 |
|
| 1954 |
# #0nν ν¨ν΄μμ μμ 0 μ κ±° (#01ν -> #1ν, #010ν -> #10ν)
|
| 1955 |
# λ¨, #0νλ κ·Έλλ‘ μ μ§
|
|
|
|
| 1938 |
for line in lines:
|
| 1939 |
converted_line = line
|
| 1940 |
|
| 1941 |
+
# νλ‘€λ‘κ·Έ μ²λ¦¬ (@νλ‘€λ‘κ·Έ, #νλ‘€λ‘κ·Έ -> #0ν νλ‘€λ‘κ·Έ)
|
| 1942 |
+
converted_line = re.sub(r'^[@#]\s*νλ‘€λ‘κ·Έ\s*', '#0ν νλ‘€λ‘κ·Έ', converted_line)
|
| 1943 |
+
|
| 1944 |
# @μ«μν ν¨ν΄ (곡백 ν¬ν¨/λ―Έν¬ν¨)
|
| 1945 |
converted_line = re.sub(r'^@\s*(\d+)\s*ν\s*', r'#\1ν', converted_line)
|
| 1946 |
|
|
|
|
| 1953 |
# μ€ μμμμ μ«μλ‘ μμνκ³ λ°λ‘ "ν"κ° μ€λ κ²½μ°
|
| 1954 |
if not re.search(r'^#\d+ν', converted_line):
|
| 1955 |
converted_line = re.sub(r'^(\d+)\s*ν\s*', r'#\1ν', converted_line)
|
| 1956 |
+
|
| 1957 |
+
# #μ«μ ν¨ν΄ (νκ° μλ κ²½μ°) - #n -> #nν
|
| 1958 |
+
if not re.search(r'^#\d+ν', converted_line):
|
| 1959 |
+
converted_line = re.sub(r'^#\s*(\d+)(?!ν)\s*', r'#\1ν', converted_line)
|
| 1960 |
|
| 1961 |
# #0nν ν¨ν΄μμ μμ 0 μ κ±° (#01ν -> #1ν, #010ν -> #10ν)
|
| 1962 |
# λ¨, #0νλ κ·Έλλ‘ μ μ§
|