Skip to content

Commit c11c3f5

Browse files
committed
Do not apply Korean rules to strings with no CJK
1 parent 72e17b5 commit c11c3f5

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

scriptshifter/hooks/korean/romanizer.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,11 @@ def _romanize_oclc_auto(kor):
386386

387387
# FKR068: Exceptions, Exceptions to initial sound law, Proper names
388388
def _kor_rom(kor):
389+
# Only convert string if it contains CJK (i.e. do not change if already romanized)
390+
# \u3000 is the ideographic space, the lowest codepoint in the Unicode CJK range
391+
if max(kor) < '\u3000':
392+
return kor
393+
389394
kor = re.sub(r"\s{2,}", " ", kor.strip())
390395
orig = kor
391396

test/data/script_samples/korean.csv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1758,3 +1758,5 @@
17581758
"korean_nonames","황홀 하고 격정적인 한국 축구 를 위하여","Hwanghol hago kyŏkchŏngjŏgin Han'guk ch'ukku rŭl wihayŏ","s2r","{""capitalize"": ""first""}","From K-Romanizer",
17591759
"korean_nonames","희망 열매 를 가꾼 지역들","Hŭimang yŏlmae rŭl kakkun chiyŏktŭl","s2r","{""capitalize"": ""first""}","From K-Romanizer",
17601760
"korean_nonames","蒙骨 의 高麗· 日本 侵攻 과 韓日 關係","Monggol ŭi Koryŏ, Ilbon ch'imgong kwa Han-Il kwan'gye","s2r","{""capitalize"": ""first""}","From K-Romanizer",
1761+
"korean_nonames","황국 flavor","hwangguk flavor","s2r","","From Tom Ventimiglia"
1762+
"korean_nonames","roasted 황국 ","roasted hwangguk","s2r","","From Tom Ventimiglia"

0 commit comments

Comments
 (0)