diff options
author | Norbert Preining <norbert@preining.info> | 2020-06-04 03:02:40 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2020-06-04 03:02:40 +0000 |
commit | 6c90555ebb89f41cc4dfb6cf3ee6bfaa8107650e (patch) | |
tree | d3475ab1d6bd6675a0975dfa6059602be057f0d5 /indexing/xindex/scripts | |
parent | 44fde4a143b75ae4f383b05832343d497c254989 (diff) |
CTAN sync 202006040302
Diffstat (limited to 'indexing/xindex/scripts')
-rwxr-xr-x | indexing/xindex/scripts/xindex.lua | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/indexing/xindex/scripts/xindex.lua b/indexing/xindex/scripts/xindex.lua index d4316b2949..2f4654ec13 100755 --- a/indexing/xindex/scripts/xindex.lua +++ b/indexing/xindex/scripts/xindex.lua @@ -8,7 +8,7 @@ ----------------------------------------------------------------------- xindex = xindex or { } - local version = 0.22 + local version = 0.23 xindex.version = version --xindex.self = "xindex" @@ -49,6 +49,7 @@ local args = require ('xindex-lapp') [[ -o,--output (default "") -l,--language (default en) -p,--prefix (default L) + -u,--use_UCA <input> (string) ]] @@ -174,6 +175,8 @@ escape_chars = { -- by default " is the escape char {esc_char..')', '//escapedparenright//',')' } } +local language = "en" -- default language + language = string.lower(args["language"]):sub(1, 2) writeLog(2,"Language = "..language.."\n",1) if (indexheader[language] == nil) then @@ -189,6 +192,39 @@ else page_folium = folium[language] end +use_UCA = args["use_UCA"] +if use_UCA then + writeLog(1,"Will use LUA-UCA\n",1) + ducet = require "lua-uca.lua-uca-ducet" + collator = require "lua-uca.lua-uca-collator" + languages = require "lua-uca.lua-uca-languages" + collator_obj = collator.new(ducet) + + local uca_config_file = "xindex-cfg-uca.lua" + writeLog(2,"Loading local UCA config file "..uca_config_file,0) + UCA_Config_File = kpse.find_file(uca_config_file) + uca_cfg = require(UCA_Config_File) + writeLog(2," ... done\n",0) + +-- language name specified on the command line doesn't seem to be available +-- in the config file, so we just try to find it ourselves + for i, a in ipairs(arg) do + if a == "-l" or a=="--language" then + language = arg[i+1] + break + end + end + + if languages[language] then + print("[Lua-UCA] Loading language: " .. language) + collator_obj = languages[language](collator_obj) + end +else + writeLog(1,"Will _not_ use LUA-UCA\n",1) +end + +upper = unicode.utf8.upper + no_caseSensitive = args["no_casesensitive"] if no_caseSensitive then writeLog(1,"Sorting will be no case sensitive\n",1) |