Spaces:
Running
Running
Minor adjustments to TranslationModel.py.
Browse files
src/translation/translationModel.py
CHANGED
@@ -425,13 +425,13 @@ class TranslationModel:
|
|
425 |
result = output[0]['translation_text']
|
426 |
|
427 |
if len(result) > 2:
|
428 |
-
if result[
|
429 |
result = result[1:-1]
|
430 |
-
elif result[
|
431 |
result = result[1:-1]
|
432 |
-
elif result[
|
433 |
result = result[1:-1]
|
434 |
-
elif result[
|
435 |
result = result[1:-1]
|
436 |
except Exception as e:
|
437 |
print(traceback.format_exc())
|
|
|
425 |
result = output[0]['translation_text']
|
426 |
|
427 |
if len(result) > 2:
|
428 |
+
if result[0] == "\"" and result[len(result) - 1] == "\"":
|
429 |
result = result[1:-1]
|
430 |
+
elif result[0] == "'" and result[len(result) - 1] == "'":
|
431 |
result = result[1:-1]
|
432 |
+
elif result[0] == "「" and result[len(result) - 1] == "」":
|
433 |
result = result[1:-1]
|
434 |
+
elif result[0] == "『" and result[len(result) - 1] == "』":
|
435 |
result = result[1:-1]
|
436 |
except Exception as e:
|
437 |
print(traceback.format_exc())
|