소스 검색

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}"