avans06 commited on
Commit
0d5acc7
1 Parent(s): 7f18dc4

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[len(result) - 1] == "\"" and result[0] == "\"":
429
  result = result[1:-1]
430
- elif result[len(result) - 1] == "'" and result[0] == "'":
431
  result = result[1:-1]
432
- elif result[len(result) - 1] == "「" and result[0] == "」":
433
  result = result[1:-1]
434
- elif result[len(result) - 1] == "『" and result[0] == "』":
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())