Переглянути джерело

Fix double hyphen in non-Korean prefix with hyphen.

scossu 5 місяців тому
батько
коміт
15758e12d0
1 змінених файлів з 3 додано та 2 видалено
  1. 3 2
      scriptshifter/hooks/korean/romanizer.py

+ 3 - 2
scriptshifter/hooks/korean/romanizer.py

@@ -504,8 +504,9 @@ def _kor_rom(kor):
     if non_kor > 0:
         logger.debug(f"Non-Korean part: {orig[:non_kor]}")
         # Modified from K-Romanizer:1727 in that it does not append a hyphen
-        # if the whole word is non-Korean.
-        if all([char in ALL_PUNCT_STR for char in orig[:non_kor]]):
+        # if the whole word is non-Korean or if the last non-Korean character
+        # is a punctuation symbol.
+        if orig[non_kor - 1] in ALL_PUNCT_STR:
             rom = f"{orig[:non_kor]}{rom}"
         elif len(rom):
             rom = f"{orig[:non_kor]}-{rom}"