summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luatexko/luatexko-normalize.lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-05-02 21:10:43 +0000
committerKarl Berry <karl@freefriends.org>2019-05-02 21:10:43 +0000
commit8c5676efab90bcd994e66dd4c3ef5e64da0cb38d (patch)
tree5289f9b7c7ad9eda0590e9021a0201c7fffa1cc5 /Master/texmf-dist/tex/luatex/luatexko/luatexko-normalize.lua
parent030b6070c99b9d787a0395499d75854156d46099 (diff)
luatexko (2may19)
git-svn-id: svn://tug.org/texlive/trunk@50924 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luatexko/luatexko-normalize.lua')
-rw-r--r--Master/texmf-dist/tex/luatex/luatexko/luatexko-normalize.lua13
1 files changed, 6 insertions, 7 deletions
diff --git a/Master/texmf-dist/tex/luatex/luatexko/luatexko-normalize.lua b/Master/texmf-dist/tex/luatex/luatexko/luatexko-normalize.lua
index b791a2497ff..895ee5b60c3 100644
--- a/Master/texmf-dist/tex/luatex/luatexko/luatexko-normalize.lua
+++ b/Master/texmf-dist/tex/luatex/luatexko/luatexko-normalize.lua
@@ -13,8 +13,8 @@
luatexbase.provides_module({
name = "luatexko-normalize",
- version = "1.23",
- date = "2019/03/24",
+ version = "2.0",
+ date = "2019/05/01",
author = "Dohyun Kim, Soojin Nam",
description = "Hangul normalization",
license = "LPPL v1.3+",
@@ -408,7 +408,6 @@ local byte = unicodeutf8.byte
local char = unicodeutf8.char
local find = unicodeutf8.find
local concat = table.concat
-local floor = math.floor
local add_to_callback = luatexbase.add_to_callback
local remove_from_callback = luatexbase.remove_from_callback
@@ -426,15 +425,15 @@ end
local syllable2jamo = function(s)
s = byte(s) - 0xac00
local t = {}
- t[1] = char(floor(s / 588) + 0x1100)
- t[2] = char(floor(s % 588 / 28) + 0x1161)
+ t[1] = char(s // 588 + 0x1100)
+ t[2] = char(s % 588 // 28 + 0x1161)
local jong = s % 28
t[3] = jong > 0 and char(jong + 0x11a7) or nil
return concat(t)
end
local hanguldecompose = function(buffer)
- return gsub(buffer, "[가-힣]", syllable2jamo)
+ return gsub(buffer, "[\234\176\128-\237\158\163]", syllable2jamo)
end
local function hanjanormalize(c)
@@ -457,7 +456,7 @@ local function jamo2cjamojung(c,t)
end
local hangulcompose = function(buffer)
- buffer = gsub(buffer, "[가-힣]"..jong, hanguldecompose)
+ buffer = gsub(buffer, "[\234\176\128-\237\158\163]"..jong, hanguldecompose)
buffer = gsub(buffer, "("..ncho..")("..njung..")("..jong.."?)", jamo2syllable)
buffer = gsub(buffer,
"([\225\132\128-\225\133\153])\225\133\160", jamo2cjamocho)