texlive[61023] Master/texmf-dist: lua-uca (10nov21)

commits+karl at tug.org commits+karl at tug.org
Wed Nov 10 22:19:05 CET 2021


Revision: 61023
          http://tug.org/svn/texlive?view=revision&revision=61023
Author:   karl
Date:     2021-11-10 22:19:05 +0100 (Wed, 10 Nov 2021)
Log Message:
-----------
lua-uca (10nov21)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/support/lua-uca/CHANGELOG.md
    trunk/Master/texmf-dist/doc/support/lua-uca/LICENSE
    trunk/Master/texmf-dist/doc/support/lua-uca/README.md
    trunk/Master/texmf-dist/doc/support/lua-uca/lua-uca-doc.pdf
    trunk/Master/texmf-dist/doc/support/lua-uca/lua-uca-doc.tex
    trunk/Master/texmf-dist/scripts/lua-uca/lua-uca-collator.lua

Modified: trunk/Master/texmf-dist/doc/support/lua-uca/CHANGELOG.md
===================================================================
--- trunk/Master/texmf-dist/doc/support/lua-uca/CHANGELOG.md	2021-11-10 21:18:41 UTC (rev 61022)
+++ trunk/Master/texmf-dist/doc/support/lua-uca/CHANGELOG.md	2021-11-10 21:19:05 UTC (rev 61023)
@@ -1,7 +1,17 @@
 # Changelog
 
+2021-11-10
+
+  - version `0.1b` released.
+
+2021-11-09
+
+  - cache string to codepoint conversion.
+  - use NFC normalization with LuaTeX.
+
 2021-09-16
 
+  - version `0.1a` released.
   - added sorting rules for all languages contained in CLDR collation files.
 
 2020-06-09
@@ -11,5 +21,5 @@
 
 2020-03-24
   
-  - version `0.1` released
-  - initial version for CTAN
+  - version `0.1` released.
+  - initial version for CTAN.

Modified: trunk/Master/texmf-dist/doc/support/lua-uca/LICENSE
===================================================================
--- trunk/Master/texmf-dist/doc/support/lua-uca/LICENSE	2021-11-10 21:18:41 UTC (rev 61022)
+++ trunk/Master/texmf-dist/doc/support/lua-uca/LICENSE	2021-11-10 21:19:05 UTC (rev 61023)
@@ -1,8 +1,14 @@
-Copyright 2020 Michal Hoftich
+Copyright 2021 Michal Hoftich
 
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
 
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
 
 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,

Modified: trunk/Master/texmf-dist/doc/support/lua-uca/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/support/lua-uca/README.md	2021-11-10 21:18:41 UTC (rev 61022)
+++ trunk/Master/texmf-dist/doc/support/lua-uca/README.md	2021-11-10 21:19:05 UTC (rev 61023)
@@ -121,3 +121,11 @@
 
 - Algorithm for setting implicit sort weights of characters that are not explicitly listed in DUCET.
 - Special handling of CJK scripts.
+
+\iffalse
+# Copyright
+
+Michal Hoftich, 2021. See LICENSE file for more details.
+
+
+\fi

Modified: trunk/Master/texmf-dist/doc/support/lua-uca/lua-uca-doc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/support/lua-uca/lua-uca-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/support/lua-uca/lua-uca-doc.tex	2021-11-10 21:18:41 UTC (rev 61022)
+++ trunk/Master/texmf-dist/doc/support/lua-uca/lua-uca-doc.tex	2021-11-10 21:19:05 UTC (rev 61023)
@@ -31,7 +31,6 @@
 
 \section{Available Languages}
 
-\begin{raggedright}
 The \texttt{lua-uca-languages} library provides the following langauges:
 \bgroup\ttfamily
 \begin{luacode*}
@@ -46,7 +45,6 @@
 tex.print(table.concat(l, ", "))
 \end{luacode*}
 \egroup
-\end{raggedright}
 
 If you want to requrest  language not listed in this listing, or if you had
 created support code for one, please contact the package author by mail or using

Modified: trunk/Master/texmf-dist/scripts/lua-uca/lua-uca-collator.lua
===================================================================
--- trunk/Master/texmf-dist/scripts/lua-uca/lua-uca-collator.lua	2021-11-10 21:18:41 UTC (rev 61022)
+++ trunk/Master/texmf-dist/scripts/lua-uca/lua-uca-collator.lua	2021-11-10 21:19:05 UTC (rev 61023)
@@ -2,6 +2,11 @@
 local math = require "math"
 local tailoring_lib = require "lua-uca.lua-uca-tailoring"
 local reordering_table = require "lua-uca.lua-uca-reordering-table"
+local uni_normalize
+-- in LuaTeX, load the lua-uni-normalize library
+if kpse then
+  uni_normalize = require "lua-uni-normalize"
+end
 
 local collator = {}
 collator.__index = collator
@@ -213,9 +218,20 @@
   return #a < #b
 end
 
+local codepoints_cache = {}
+
 function collator:string_to_codepoints(a)
+  if codepoints_cache[a] then return codepoints_cache[a] end
+  -- try unicode normalization, if it is available
+  -- it uses libraries available in LuaTeX, so it doesn't work with 
+  -- stock Lua
+  local normalized = a
+  if uni_normalize then 
+    normalized = uni_normalize.NFC(a) 
+  end
   local codepoints = {}
-  for _, code in utf8.codes(a) do codepoints[#codepoints+1] = code end
+  for _, code in utf8.codes(normalized) do codepoints[#codepoints+1] = code end
+  codepoints_cache[a] = codepoints
   return codepoints
 end
 



More information about the tex-live-commits mailing list.