From 26ae25dbea9b066eae665f8aefb2b046ac67d431 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 24 Dec 2010 14:48:09 +0100 Subject: =?UTF-8?q?using=20context=E2=80=99s=20builtin=20pattern=20for=20u?= =?UTF-8?q?tf8=20characters?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../third/transliterator/trans_tables_trsc.lua | 23 +++------------------- 1 file changed, 3 insertions(+), 20 deletions(-) (limited to 'tex/context/third/transliterator/trans_tables_trsc.lua') diff --git a/tex/context/third/transliterator/trans_tables_trsc.lua b/tex/context/third/transliterator/trans_tables_trsc.lua index cad3567..0458539 100644 --- a/tex/context/third/transliterator/trans_tables_trsc.lua +++ b/tex/context/third/transliterator/trans_tables_trsc.lua @@ -487,17 +487,10 @@ translit.tables["Czech transcription for OCS and pre-1918 uppercase"] = translit function translit.transcript (mode, text) local P, R, S, V, Cs = lpeg.P, lpeg.R, lpeg.S, lpeg.V, lpeg.Cs - local loc = lpeg.locale () + local addrules = translit.addrules + local utfchar = lpeg.patterns.utf8char - -- http://lua-users.org/lists/lua-l/2009-06/msg00343.html - local utfchar = R("\000\127") + - R("\194\223") * R("\128\191") + - R("\224\240") * R("\128\191") * R("\128\191") + - R("\241\244") * R("\128\191") * R("\128\191") * R("\128\191") - - local trsc_parser, p_rules, capt - - local p_de + local trsc_parser, p_rules, capt, p_de function tab_subst (s, ...) local p_tmp, tmp = nil, translit.make_add_dict{} @@ -509,16 +502,6 @@ function translit.transcript (mode, text) return fp:match(s) end - -- Add keys of a dictionary to a ruleset. - function addrules (dict, rules) - for i, _ in pairs(dict) do - if rules == nil then rules = P(i) - else rules = rules + P(i) - end - end - return rules - end - -- The following is needed becaus lpeg.S doesn't work with utf. local vow, con, iy for _,v in ipairs (translit.ru_vowels) do -- cgit v1.2.3