diff options
author | Karl Berry <karl@freefriends.org> | 2021-09-16 20:18:12 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-09-16 20:18:12 +0000 |
commit | b33e18a5efa7b022c42aee2adec507dd6917ec28 (patch) | |
tree | bba2f6f8bc7a840ba65e5ec0ec78d3ec5a463deb /Master/texmf-dist/doc/support/lua-uca/README.md | |
parent | fd4d90b5caf562a8d951bb4a3b78a1aa74930017 (diff) |
lua-uca (16sep21)
git-svn-id: svn://tug.org/texlive/trunk@60523 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/support/lua-uca/README.md')
-rw-r--r-- | Master/texmf-dist/doc/support/lua-uca/README.md | 38 |
1 files changed, 12 insertions, 26 deletions
diff --git a/Master/texmf-dist/doc/support/lua-uca/README.md b/Master/texmf-dist/doc/support/lua-uca/README.md index b3cef273ea3..37343a83afd 100644 --- a/Master/texmf-dist/doc/support/lua-uca/README.md +++ b/Master/texmf-dist/doc/support/lua-uca/README.md @@ -1,15 +1,9 @@ +\iffalse # The `Lua-UCA` package +\fi This package adds support for the [Unicode collation algorithm](https://unicode.org/reports/tr10/) for Lua 5.3. -## Install - -The package needs to download Unicode collation data and convert it to a Lua table. It depends on `wget` and `unzip` utitilities. - -To install the package in the local TEXMF tree, run: - - make - make install ## Usage @@ -43,18 +37,17 @@ The output: > chochol > jasan -More samples of use can be found in the `spec` directory. -`tools/indexing-sample.lua` is a simple indexing processor. +More samples of the library usage can be found in the source repository of this package on [Github](https://github.com/michal-h21/lua-uca). +% See `HACKING.md` file in the repo for more information. ## Use with Xindex processor [Xindex](https://www.ctan.org/pkg/xindex) is flexible index processor written -in Lua by Herbert Voß. It supports Lua configuration files, which enables use -of Lua-UCA for sorting of the index entries, as shown in [this -example](https://tex.stackexchange.com/a/524014/2891) for Norwegian text. +in Lua by Herbert Voß. It has built-in `Lua-UCA` support starting with version +`0.23`. The support can be requested using the `-u` option: + + xindex -u -l no -c norsk filename.idx -The `xindex` directory in the [source repository](https://github.com/michal-h21/lua-uca/tree/master/xindex) contains more advanced version of such configuration -file together with several examples. Run `make xindex` command to compile them. ## Change sorting rules @@ -90,7 +83,7 @@ It is also possible to expand a letter to multiple letters, like this example fo tailoring "&Ö=Oe" tailoring "&ö=oe" -Some languages, like Norwegian sort uppercase letters before lowercase. This +Some languages, like Norwegian, sort uppercase letters before lowercase. This can be enabled using `collator_obj:uppercase_first()` function: local tailoring = function(s) collator_obj:tailor_string(s) end @@ -102,14 +95,8 @@ can be enabled using `collator_obj:uppercase_first()` function: tailoring("&ǀ<æ<<<Æ<<ä<<<Ä<ø<<<Ø<<ö<<<Ö<<ő<<<Ő<å<<<Å<<<aa<<<Aa<<<AA") tailoring("&oe<<œ<<<Œ") -The `data/common/collation/` directory contains files from the `CLDR` project. -They contain rules for many languages. The files needs to be normalized to the -[NFC form](https://en.wikipedia.org/wiki/Unicode_equivalence), for example -using: - - cat cs.xml | uconv -x any-nfc -o cs.xml - -The `uconv` utility is a part of the [ICU Project](http://userguide.icu-project.org/). +% More information on a new language support is in the `HACKING.md` +% document in the [`Lua-UCA` Github repo](https://github.com/michal-h21/lua-uca/blob/master/HACKING.md). ### Script reordering @@ -117,7 +104,7 @@ Many languages sort different scripts after the script this language uses. As Latin based scripts are sorted first, it is necessary to reorder scripts in such cases. -The `collator_obj:reorder` function takes table with scripts that need to be reorderd. +The `collator_obj:reorder` function takes table with scripts that need to be reordered. For example Cyrillic can be sorted before Latin using: collator_obj:reorder {"cyrillic"} @@ -132,6 +119,5 @@ will be sorted at the very end. # What is missing -- Tailorings for most languages. - Algorithm for setting implicit sort weights of characters that are not explicitly listed in DUCET. - Special handling of CJK scripts. |