summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorTakuji Tanaka <ttk@t-lab.opal.ne.jp>2022-05-22 12:54:30 +0000
committerTakuji Tanaka <ttk@t-lab.opal.ne.jp>2022-05-22 12:54:30 +0000
commit7c14abb2a942b2f8af4a23040dab953da7cba20e (patch)
tree6d951a5b2edf741ec85f156e720684cf2c5a7f70 /Build
parent387205a83ab959e03fb537fc33d12650d09e3695 (diff)
upmendex: Improve heuristic detection of page number types
git-svn-id: svn://tug.org/texlive/trunk@63363 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/upmendex/ChangeLog12
-rw-r--r--Build/source/texk/upmendex/Makefile.am21
-rw-r--r--Build/source/texk/upmendex/Makefile.in23
-rwxr-xr-xBuild/source/texk/upmendex/configure22
-rw-r--r--Build/source/texk/upmendex/configure.ac2
-rw-r--r--Build/source/texk/upmendex/fread.c26
-rw-r--r--Build/source/texk/upmendex/tests/pprec5.ist3
-rw-r--r--Build/source/texk/upmendex/tests/pprec6.ist3
-rw-r--r--Build/source/texk/upmendex/tests/pprec7.ist3
-rw-r--r--Build/source/texk/upmendex/tests/romalpA-5.ind5
-rw-r--r--Build/source/texk/upmendex/tests/romalpA-6.ind5
-rw-r--r--Build/source/texk/upmendex/tests/romalpA.idx7
-rw-r--r--Build/source/texk/upmendex/tests/romalpB-5.ind14
-rw-r--r--Build/source/texk/upmendex/tests/romalpB-6.ind14
-rw-r--r--Build/source/texk/upmendex/tests/romalpB-7.ind14
-rw-r--r--Build/source/texk/upmendex/tests/romalpB.idx60
-rw-r--r--Build/source/texk/upmendex/tests/romalpC-5.ind14
-rw-r--r--Build/source/texk/upmendex/tests/romalpC.idx76
-rw-r--r--Build/source/texk/upmendex/tests/romalpD-5.ind9
-rw-r--r--Build/source/texk/upmendex/tests/romalpD-6.ind9
-rw-r--r--Build/source/texk/upmendex/tests/romalpD-7.ind9
-rw-r--r--Build/source/texk/upmendex/tests/romalpD.idx35
-rwxr-xr-xBuild/source/texk/upmendex/tests/upmendex.test105
23 files changed, 417 insertions, 74 deletions
diff --git a/Build/source/texk/upmendex/ChangeLog b/Build/source/texk/upmendex/ChangeLog
index 4445ad62f01..3d319cca616 100644
--- a/Build/source/texk/upmendex/ChangeLog
+++ b/Build/source/texk/upmendex/ChangeLog
@@ -1,3 +1,15 @@
+2022-05-22 TANAKA Takuji <ttk@t-lab.opal.ne.jp>
+
+ * version 1.01 Stable version.
+ * configure.ac: Bump version.
+ * fread.c:
+ Modify heuristic detection of page number types
+ for ambiguous ones between roman number and alphabet.
+ * tests/upmendex.test, tests/pprec[567].ist,
+ tests/romalp[ABCD].idx, tests/romalpA-[56].ind,
+ tests/romalp[BD]-[567].ind, tests/romalpC-5.ind, Makefile.am:
+ Update tests.
+
2022-03-21 Karl Berry <karl@tug.org>
* TL'22 release.
diff --git a/Build/source/texk/upmendex/Makefile.am b/Build/source/texk/upmendex/Makefile.am
index 44b3871623c..3dd956d5301 100644
--- a/Build/source/texk/upmendex/Makefile.am
+++ b/Build/source/texk/upmendex/Makefile.am
@@ -57,7 +57,20 @@ EXTRA_DIST += $(TESTS)
## tests/upmendex.test
EXTRA_DIST += tests/foo.idx tests/foo.ind \
- tests/uni.idx tests/uni.dict tests/uni.ist tests/uni.ind \
- tests/pprec0.ist tests/pprec1.ist tests/pprec2.ist tests/pprecA.idx \
- tests/pprecA-0.ind tests/pprecA-1.ind tests/pprecA-2.ind
-DISTCLEANFILES = foo.* uni.* pprec*.*
+ tests/uni.idx tests/uni.dict tests/uni.ist \
+ tests/uni1.ist tests/uni2.ist tests/uni.ind \
+ tests/range.idx tests/range2.ist tests/range2.ist tests/range3.ist \
+ tests/range1.ind tests/range2.ind tests/range3.ind \
+ tests/pprec0.ist tests/pprec1.ist tests/pprec2.ist tests/pprec3.ist \
+ tests/pprec4.ist tests/pprec5.ist tests/pprec6.ist tests/pprec7.ist \
+ tests/pprecA.idx tests/pprecA-0.ind tests/pprecA-1.ind tests/pprecA-2.ind \
+ tests/pprecB.idx tests/pprecB-0.ind tests/pprecB-3.ind tests/pprecB-4.ind \
+ tests/romalpA.idx tests/romalpA-5.ind tests/romalpA-6.ind \
+ tests/romalpB.idx tests/romalpB-5.ind tests/romalpB-6.ind tests/romalpB-7.ind \
+ tests/romalpC.idx tests/romalpC-5.ind \
+ tests/romalpD.idx tests/romalpD-5.ind tests/romalpD-6.ind tests/romalpD-7.ind
+DISTCLEANFILES = foo.* uni.* range*.* pprec*.* romalp*.*
+EXTRA_DIST += tests/locale1.ist tests/locale2.ist tests/rule.idx \
+ tests/attr1.ist tests/attr1.ind tests/locale1.ind tests/locale2-rule.ind \
+ tests/rule1.ist tests/rule2.ist tests/rule3.ist tests/rule4.ist rule.ind
+DISTCLEANFILES += locale*.* attr*.* rule*.*
diff --git a/Build/source/texk/upmendex/Makefile.in b/Build/source/texk/upmendex/Makefile.in
index 4ecaadee97b..2b18866de88 100644
--- a/Build/source/texk/upmendex/Makefile.in
+++ b/Build/source/texk/upmendex/Makefile.in
@@ -609,11 +609,26 @@ nodist_EXTRA_upmendex_SOURCES = dummy.cxx
LDADD = $(KPATHSEA_LIBS) $(ICU_LIBS) $(PTHREAD_LIB) $(ICU_LIBS_EXTRA)
EXTRA_DIST = COPYRIGHT indexsty upmendex.ja.txt $(TESTS) tests/foo.idx \
tests/foo.ind tests/uni.idx tests/uni.dict tests/uni.ist \
- tests/uni.ind tests/pprec0.ist tests/pprec1.ist \
- tests/pprec2.ist tests/pprecA.idx tests/pprecA-0.ind \
- tests/pprecA-1.ind tests/pprecA-2.ind
+ tests/uni1.ist tests/uni2.ist tests/uni.ind tests/range.idx \
+ tests/range2.ist tests/range2.ist tests/range3.ist \
+ tests/range1.ind tests/range2.ind tests/range3.ind \
+ tests/pprec0.ist tests/pprec1.ist tests/pprec2.ist \
+ tests/pprec3.ist tests/pprec4.ist tests/pprec5.ist \
+ tests/pprec6.ist tests/pprec7.ist tests/pprecA.idx \
+ tests/pprecA-0.ind tests/pprecA-1.ind tests/pprecA-2.ind \
+ tests/pprecB.idx tests/pprecB-0.ind tests/pprecB-3.ind \
+ tests/pprecB-4.ind tests/romalpA.idx tests/romalpA-5.ind \
+ tests/romalpA-6.ind tests/romalpB.idx tests/romalpB-5.ind \
+ tests/romalpB-6.ind tests/romalpB-7.ind tests/romalpC.idx \
+ tests/romalpC-5.ind tests/romalpD.idx tests/romalpD-5.ind \
+ tests/romalpD-6.ind tests/romalpD-7.ind tests/locale1.ist \
+ tests/locale2.ist tests/rule.idx tests/attr1.ist \
+ tests/attr1.ind tests/locale1.ind tests/locale2-rule.ind \
+ tests/rule1.ist tests/rule2.ist tests/rule3.ist \
+ tests/rule4.ist rule.ind
TESTS = tests/upmendex.test
-DISTCLEANFILES = foo.* uni.* pprec*.*
+DISTCLEANFILES = foo.* uni.* range*.* pprec*.* romalp*.* locale*.* \
+ attr*.* rule*.*
all: c-auto.h
$(MAKE) $(AM_MAKEFLAGS) all-am
diff --git a/Build/source/texk/upmendex/configure b/Build/source/texk/upmendex/configure
index 47f644f5095..66ca5cbaec5 100755
--- a/Build/source/texk/upmendex/configure
+++ b/Build/source/texk/upmendex/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.71 for upmendex (TeX Live) 1.00.
+# Generated by GNU Autoconf 2.71 for upmendex (TeX Live) 1.01.
#
#
# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation,
@@ -626,8 +626,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='upmendex (TeX Live)'
PACKAGE_TARNAME='upmendex--tex-live-'
-PACKAGE_VERSION='1.00'
-PACKAGE_STRING='upmendex (TeX Live) 1.00'
+PACKAGE_VERSION='1.01'
+PACKAGE_STRING='upmendex (TeX Live) 1.01'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -1390,7 +1390,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures upmendex (TeX Live) 1.00 to adapt to many kinds of systems.
+\`configure' configures upmendex (TeX Live) 1.01 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1462,7 +1462,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of upmendex (TeX Live) 1.00:";;
+ short | recursive ) echo "Configuration of upmendex (TeX Live) 1.01:";;
esac
cat <<\_ACEOF
@@ -1587,7 +1587,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-upmendex (TeX Live) configure 1.00
+upmendex (TeX Live) configure 1.01
generated by GNU Autoconf 2.71
Copyright (C) 2021 Free Software Foundation, Inc.
@@ -2268,7 +2268,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by upmendex (TeX Live) $as_me 1.00, which was
+It was created by upmendex (TeX Live) $as_me 1.01, which was
generated by GNU Autoconf 2.71. Invocation command line was
$ $0$ac_configure_args_raw
@@ -8806,7 +8806,7 @@ fi
# Define the identity of the package.
PACKAGE='upmendex--tex-live-'
- VERSION='1.00'
+ VERSION='1.01'
# Some tools Automake needs.
@@ -18942,7 +18942,7 @@ Usage: $0 [OPTIONS]
Report bugs to <bug-libtool@gnu.org>."
lt_cl_version="\
-upmendex (TeX Live) config.lt 1.00
+upmendex (TeX Live) config.lt 1.01
configured by $0, generated by GNU Autoconf 2.71.
Copyright (C) 2011 Free Software Foundation, Inc.
@@ -21114,7 +21114,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by upmendex (TeX Live) $as_me 1.00, which was
+This file was extended by upmendex (TeX Live) $as_me 1.01, which was
generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -21182,7 +21182,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
-upmendex (TeX Live) config.status 1.00
+upmendex (TeX Live) config.status 1.01
configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
diff --git a/Build/source/texk/upmendex/configure.ac b/Build/source/texk/upmendex/configure.ac
index 7fb3b690c71..bbf8fd9157d 100644
--- a/Build/source/texk/upmendex/configure.ac
+++ b/Build/source/texk/upmendex/configure.ac
@@ -8,7 +8,7 @@ dnl This file is free software; the copyright holder
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl
-AC_INIT([upmendex (TeX Live)],[1.00])
+AC_INIT([upmendex (TeX Live)],[1.01])
AC_PREREQ([2.71])
AC_CONFIG_SRCDIR([main.c])
AC_CONFIG_AUX_DIR([../../build-aux])
diff --git a/Build/source/texk/upmendex/fread.c b/Build/source/texk/upmendex/fread.c
index 66d3e0b1449..ab3dd4c0770 100644
--- a/Build/source/texk/upmendex/fread.c
+++ b/Build/source/texk/upmendex/fread.c
@@ -268,7 +268,7 @@ LOOP:
nest++;
else if (buff[j]==arg_close) {
if (nest==0) {
- table[k]='\0';
+ table[k]='\0';
ind[0].p[0].page=xstrdup(table);
break;
}
@@ -495,6 +495,7 @@ static void chkpageattr(struct page *p)
{
int i,j,cc=0,cnt,pplen,pclen;
char buff[16],*pcpos,*page0;
+ static char pattr_prev[PAGE_COMPOSIT_DEPTH] = {0};
pplen=strlen(page_precedence);
pclen=strlen(page_compositor);
@@ -538,23 +539,25 @@ ATTRLOOP:
switch(page_precedence[pattr[cc]]) {
case 'r':
if (strchr("ivxlcdm",*page0)==NULL ||
- (strchr("lcdm",*page0) && strchr(page_precedence,'a') && strlen(buff)==1 && pcpos)) {
+ (strchr("lcdm",*page0) && strchr(page_precedence,'a') && strlen(buff)==1 &&
+ pattr_prev[cc]!='r')) {
/* heuristic detection as alphabet since L=50, C=100, D=100, M=1000 are quite large */
if (pattr[cc]<pplen-1)
pattr[cc]++;
else pattr[cc]=0;
- for (j=cc+1;j<3;j++) pattr[j]=0;
+ for (j=cc+1;j<PAGE_COMPOSIT_DEPTH;j++) pattr[j]=0;
goto ATTRLOOP;
}
break;
case 'R':
if (strchr("IVXLCDM",*page0)==NULL ||
- (strchr("LCDM",*page0) && strchr(page_precedence,'A') && strlen(buff)==1 && pcpos)) {
+ (strchr("LCDM",*page0) && strchr(page_precedence,'A') && strlen(buff)==1 &&
+ pattr_prev[cc]!='R')) {
/* heuristic detection as alphabet since L=50, C=100, D=100, M=1000 are quite large */
if (pattr[cc]<pplen-1)
pattr[cc]++;
else pattr[cc]=0;
- for (j=cc+1;j<3;j++) pattr[j]=0;
+ for (j=cc+1;j<PAGE_COMPOSIT_DEPTH;j++) pattr[j]=0;
goto ATTRLOOP;
}
break;
@@ -563,29 +566,31 @@ ATTRLOOP:
if (pattr[cc]<pplen-1)
pattr[cc]++;
else pattr[cc]=0;
- for (j=cc+1;j<3;j++) pattr[j]=0;
+ for (j=cc+1;j<PAGE_COMPOSIT_DEPTH;j++) pattr[j]=0;
goto ATTRLOOP;
}
break;
case 'a':
if (*page0<'a' || *page0>'z' || strlen(buff)>1 ||
- (strchr("ivx",*page0) && strchr(page_precedence,'r') && !pcpos)) {
+ (strchr("ivx",*page0) && strchr(page_precedence,'r') &&
+ pattr_prev[cc]!='a')) {
/* heuristic detection as roman number since I=1, V=5, X=10 are quite small */
if (pattr[cc]<pplen-1)
pattr[cc]++;
else pattr[cc]=0;
- for (j=cc+1;j<3;j++) pattr[j]=0;
+ for (j=cc+1;j<PAGE_COMPOSIT_DEPTH;j++) pattr[j]=0;
goto ATTRLOOP;
}
break;
case 'A':
if (*page0<'A' || *page0>'Z' || strlen(buff)>1 ||
- (strchr("IVX",*page0) && strchr(page_precedence,'R') && !pcpos)) {
+ (strchr("IVX",*page0) && strchr(page_precedence,'R') &&
+ pattr_prev[cc]!='A')) {
/* heuristic detection as roman number since I=1, V=5, X=10 are quite small */
if (pattr[cc]<pplen-1)
pattr[cc]++;
else pattr[cc]=0;
- for (j=cc+1;j<3;j++) pattr[j]=0;
+ for (j=cc+1;j<PAGE_COMPOSIT_DEPTH;j++) pattr[j]=0;
goto ATTRLOOP;
}
break;
@@ -594,6 +599,7 @@ ATTRLOOP:
page_precedence[pattr[cc]], page_precedence);
exit(253);
}
+ pattr_prev[cc] = page_precedence[pattr[cc]];
}
}
p->attr[cc]=pattr[cc];
diff --git a/Build/source/texk/upmendex/tests/pprec5.ist b/Build/source/texk/upmendex/tests/pprec5.ist
new file mode 100644
index 00000000000..400d70c7862
--- /dev/null
+++ b/Build/source/texk/upmendex/tests/pprec5.ist
@@ -0,0 +1,3 @@
+% page_precedence "rnaRA"
+
+line_max 299
diff --git a/Build/source/texk/upmendex/tests/pprec6.ist b/Build/source/texk/upmendex/tests/pprec6.ist
new file mode 100644
index 00000000000..5463ac25a46
--- /dev/null
+++ b/Build/source/texk/upmendex/tests/pprec6.ist
@@ -0,0 +1,3 @@
+page_precedence "rnR"
+
+line_max 299
diff --git a/Build/source/texk/upmendex/tests/pprec7.ist b/Build/source/texk/upmendex/tests/pprec7.ist
new file mode 100644
index 00000000000..f600c5b230f
--- /dev/null
+++ b/Build/source/texk/upmendex/tests/pprec7.ist
@@ -0,0 +1,3 @@
+page_precedence "naA"
+
+line_max 299
diff --git a/Build/source/texk/upmendex/tests/romalpA-5.ind b/Build/source/texk/upmendex/tests/romalpA-5.ind
new file mode 100644
index 00000000000..fd0b0ec4490
--- /dev/null
+++ b/Build/source/texk/upmendex/tests/romalpA-5.ind
@@ -0,0 +1,5 @@
+\begin{theindex}
+
+ \item foo, I-13, I-15--I-17, II-10, II-20, II-30
+
+\end{theindex}
diff --git a/Build/source/texk/upmendex/tests/romalpA-6.ind b/Build/source/texk/upmendex/tests/romalpA-6.ind
new file mode 100644
index 00000000000..fd0b0ec4490
--- /dev/null
+++ b/Build/source/texk/upmendex/tests/romalpA-6.ind
@@ -0,0 +1,5 @@
+\begin{theindex}
+
+ \item foo, I-13, I-15--I-17, II-10, II-20, II-30
+
+\end{theindex}
diff --git a/Build/source/texk/upmendex/tests/romalpA.idx b/Build/source/texk/upmendex/tests/romalpA.idx
new file mode 100644
index 00000000000..03b0646678b
--- /dev/null
+++ b/Build/source/texk/upmendex/tests/romalpA.idx
@@ -0,0 +1,7 @@
+\indexentry{foo}{I-13}
+\indexentry{foo}{I-15}
+\indexentry{foo}{I-16}
+\indexentry{foo}{I-17}
+\indexentry{foo}{II-10}
+\indexentry{foo}{II-20}
+\indexentry{foo}{II-30}
diff --git a/Build/source/texk/upmendex/tests/romalpB-5.ind b/Build/source/texk/upmendex/tests/romalpB-5.ind
new file mode 100644
index 00000000000..de3d9903bb8
--- /dev/null
+++ b/Build/source/texk/upmendex/tests/romalpB-5.ind
@@ -0,0 +1,14 @@
+\begin{theindex}
+
+ \item bar, I-i-10-C-c, I-i-20-C-c, I-v-10-C-c, I-v-20-C-c, I-x-10-C-c, I-x-20-C-c, I-l-10-C-c, I-l-20-C-c, I-c-10-C-c, I-c-20-C-c, I-d-10-C-c, I-d-20-C-c, I-m-10-C-c, I-m-20-C-c
+ \item baz, I-i-10-C-c, I-i-10-D-c, I-i-10-I-c, I-i-10-L-c, I-i-10-M-c, I-i-10-V-c, I-i-10-X-c, I-i-20-C-c, I-i-20-D-c, I-i-20-I-c, I-i-20-L-c, I-i-20-M-c, I-i-20-V-c, I-i-20-X-c
+
+ \indexspace
+
+ \item foo, I-i-10-C-c, I-i-20-C-c, V-i-10-C-c, V-i-20-C-c, X-i-10-C-c, X-i-20-C-c, L-i-10-C-c, L-i-20-C-c, C-i-10-C-c, C-i-20-C-c, D-i-10-C-c, D-i-20-C-c, M-i-10-C-c, M-i-20-C-c
+
+ \indexspace
+
+ \item qux, I-i-10-C-c, I-i-10-C-d, I-i-10-C-i, I-i-10-C-l, I-i-10-C-m, I-i-10-C-v, I-i-10-C-x, I-i-20-C-c, I-i-20-C-d, I-i-20-C-i, I-i-20-C-l, I-i-20-C-m, I-i-20-C-v, I-i-20-C-x
+
+\end{theindex}
diff --git a/Build/source/texk/upmendex/tests/romalpB-6.ind b/Build/source/texk/upmendex/tests/romalpB-6.ind
new file mode 100644
index 00000000000..b5d7d040b54
--- /dev/null
+++ b/Build/source/texk/upmendex/tests/romalpB-6.ind
@@ -0,0 +1,14 @@
+\begin{theindex}
+
+ \item bar, I-i-10-C-c, I-i-20-C-c, I-v-10-C-c, I-v-20-C-c, I-x-10-C-c, I-x-20-C-c, I-l-10-C-c, I-l-20-C-c, I-c-10-C-c, I-c-20-C-c, I-d-10-C-c, I-d-20-C-c, I-m-10-C-c, I-m-20-C-c
+ \item baz, I-i-10-I-c, I-i-10-V-c, I-i-10-X-c, I-i-10-L-c, I-i-10-C-c, I-i-10-D-c, I-i-10-M-c, I-i-20-I-c, I-i-20-V-c, I-i-20-X-c, I-i-20-L-c, I-i-20-C-c, I-i-20-D-c, I-i-20-M-c
+
+ \indexspace
+
+ \item foo, I-i-10-C-c, I-i-20-C-c, V-i-10-C-c, V-i-20-C-c, X-i-10-C-c, X-i-20-C-c, L-i-10-C-c, L-i-20-C-c, C-i-10-C-c, C-i-20-C-c, D-i-10-C-c, D-i-20-C-c, M-i-10-C-c, M-i-20-C-c
+
+ \indexspace
+
+ \item qux, I-i-10-C-i, I-i-10-C-v, I-i-10-C-x, I-i-10-C-l, I-i-10-C-c, I-i-10-C-d, I-i-10-C-m, I-i-20-C-i, I-i-20-C-v, I-i-20-C-x, I-i-20-C-l, I-i-20-C-c, I-i-20-C-d, I-i-20-C-m
+
+\end{theindex}
diff --git a/Build/source/texk/upmendex/tests/romalpB-7.ind b/Build/source/texk/upmendex/tests/romalpB-7.ind
new file mode 100644
index 00000000000..f65c311dfe4
--- /dev/null
+++ b/Build/source/texk/upmendex/tests/romalpB-7.ind
@@ -0,0 +1,14 @@
+\begin{theindex}
+
+ \item bar, I-c-10-C-c, I-c-20-C-c, I-d-10-C-c, I-d-20-C-c, I-i-10-C-c, I-i-20-C-c, I-l-10-C-c, I-l-20-C-c, I-m-10-C-c, I-m-20-C-c, I-v-10-C-c, I-v-20-C-c, I-x-10-C-c, I-x-20-C-c
+ \item baz, I-i-10-C-c, I-i-10-D-c, I-i-10-I-c, I-i-10-L-c, I-i-10-M-c, I-i-10-V-c, I-i-10-X-c, I-i-20-C-c, I-i-20-D-c, I-i-20-I-c, I-i-20-L-c, I-i-20-M-c, I-i-20-V-c, I-i-20-X-c
+
+ \indexspace
+
+ \item foo, C-i-10-C-c, C-i-20-C-c, D-i-10-C-c, D-i-20-C-c, I-i-10-C-c, I-i-20-C-c, L-i-10-C-c, L-i-20-C-c, M-i-10-C-c, M-i-20-C-c, V-i-10-C-c, V-i-20-C-c, X-i-10-C-c, X-i-20-C-c
+
+ \indexspace
+
+ \item qux, I-i-10-C-c, I-i-10-C-d, I-i-10-C-i, I-i-10-C-l, I-i-10-C-m, I-i-10-C-v, I-i-10-C-x, I-i-20-C-c, I-i-20-C-d, I-i-20-C-i, I-i-20-C-l, I-i-20-C-m, I-i-20-C-v, I-i-20-C-x
+
+\end{theindex}
diff --git a/Build/source/texk/upmendex/tests/romalpB.idx b/Build/source/texk/upmendex/tests/romalpB.idx
new file mode 100644
index 00000000000..a56460db3b7
--- /dev/null
+++ b/Build/source/texk/upmendex/tests/romalpB.idx
@@ -0,0 +1,60 @@
+\indexentry{foo}{I-i-10-C-c}
+\indexentry{foo}{I-i-20-C-c}
+\indexentry{foo}{V-i-10-C-c}
+\indexentry{foo}{V-i-20-C-c}
+\indexentry{foo}{X-i-10-C-c}
+\indexentry{foo}{X-i-20-C-c}
+\indexentry{foo}{L-i-10-C-c}
+\indexentry{foo}{L-i-20-C-c}
+\indexentry{foo}{C-i-10-C-c}
+\indexentry{foo}{C-i-20-C-c}
+\indexentry{foo}{D-i-10-C-c}
+\indexentry{foo}{D-i-20-C-c}
+\indexentry{foo}{M-i-10-C-c}
+\indexentry{foo}{M-i-20-C-c}
+
+\indexentry{bar}{I-i-10-C-c}
+\indexentry{bar}{I-i-20-C-c}
+\indexentry{bar}{I-v-10-C-c}
+\indexentry{bar}{I-v-20-C-c}
+\indexentry{bar}{I-x-10-C-c}
+\indexentry{bar}{I-x-20-C-c}
+\indexentry{bar}{I-l-10-C-c}
+\indexentry{bar}{I-l-20-C-c}
+\indexentry{bar}{I-c-10-C-c}
+\indexentry{bar}{I-c-20-C-c}
+\indexentry{bar}{I-d-10-C-c}
+\indexentry{bar}{I-d-20-C-c}
+\indexentry{bar}{I-m-10-C-c}
+\indexentry{bar}{I-m-20-C-c}
+
+\indexentry{baz}{I-i-10-C-c}
+\indexentry{baz}{I-i-20-C-c}
+\indexentry{baz}{I-i-10-D-c}
+\indexentry{baz}{I-i-20-D-c}
+\indexentry{baz}{I-i-10-I-c}
+\indexentry{baz}{I-i-20-I-c}
+\indexentry{baz}{I-i-10-L-c}
+\indexentry{baz}{I-i-20-L-c}
+\indexentry{baz}{I-i-10-M-c}
+\indexentry{baz}{I-i-20-M-c}
+\indexentry{baz}{I-i-10-V-c}
+\indexentry{baz}{I-i-20-V-c}
+\indexentry{baz}{I-i-10-X-c}
+\indexentry{baz}{I-i-20-X-c}
+
+\indexentry{qux}{I-i-10-C-c}
+\indexentry{qux}{I-i-20-C-c}
+\indexentry{qux}{I-i-10-C-d}
+\indexentry{qux}{I-i-20-C-d}
+\indexentry{qux}{I-i-10-C-i}
+\indexentry{qux}{I-i-20-C-i}
+\indexentry{qux}{I-i-10-C-l}
+\indexentry{qux}{I-i-20-C-l}
+\indexentry{qux}{I-i-10-C-m}
+\indexentry{qux}{I-i-20-C-m}
+\indexentry{qux}{I-i-10-C-v}
+\indexentry{qux}{I-i-20-C-v}
+\indexentry{qux}{I-i-10-C-x}
+\indexentry{qux}{I-i-20-C-x}
+
diff --git a/Build/source/texk/upmendex/tests/romalpC-5.ind b/Build/source/texk/upmendex/tests/romalpC-5.ind
new file mode 100644
index 00000000000..2edc90d1ef9
--- /dev/null
+++ b/Build/source/texk/upmendex/tests/romalpC-5.ind
@@ -0,0 +1,14 @@
+\begin{theindex}
+
+ \item bar, I-i-10-C-c, I-i-20-C-c, I-ii-10-C-c, I-ii-20-C-c, I-iii-10-C-c, I-iii-20-C-c, I-v-10-C-c, I-v-20-C-c, I-x-10-C-c, I-x-20-C-c, I-l-10-C-c, I-l-20-C-c, I-c-10-C-c, I-c-20-C-c, I-d-10-C-c, I-d-20-C-c, I-m-10-C-c, I-m-20-C-c
+ \item baz, I-i-10-A-c, I-i-10-B-c, I-i-10-C-c, I-i-10-D-c, I-i-10-I-c, I-i-10-L-c, I-i-10-M-c, I-i-10-V-c, I-i-10-X-c, I-i-20-A-c, I-i-20-B-c, I-i-20-C-c, I-i-20-D-c, I-i-20-I-c, I-i-20-L-c, I-i-20-M-c, I-i-20-V-c, I-i-20-X-c
+
+ \indexspace
+
+ \item foo, I-i-10-C-c, I-i-20-C-c, II-i-10-C-c, II-i-20-C-c, III-i-10-C-c, III-i-20-C-c, V-i-10-C-c, V-i-20-C-c, X-i-10-C-c, X-i-20-C-c, L-i-10-C-c, L-i-20-C-c, C-i-10-C-c, C-i-20-C-c, D-i-10-C-c, D-i-20-C-c, M-i-10-C-c, M-i-20-C-c
+
+ \indexspace
+
+ \item qux, I-i-10-C-a--I-i-10-C-d, I-i-10-C-i, I-i-10-C-l, I-i-10-C-m, I-i-10-C-v, I-i-10-C-x, I-i-20-C-a--I-i-20-C-d, I-i-20-C-i, I-i-20-C-l, I-i-20-C-m, I-i-20-C-v, I-i-20-C-x
+
+\end{theindex}
diff --git a/Build/source/texk/upmendex/tests/romalpC.idx b/Build/source/texk/upmendex/tests/romalpC.idx
new file mode 100644
index 00000000000..208686338a6
--- /dev/null
+++ b/Build/source/texk/upmendex/tests/romalpC.idx
@@ -0,0 +1,76 @@
+\indexentry{foo}{I-i-10-C-c}
+\indexentry{foo}{I-i-20-C-c}
+\indexentry{foo}{II-i-10-C-c}
+\indexentry{foo}{II-i-20-C-c}
+\indexentry{foo}{III-i-10-C-c}
+\indexentry{foo}{III-i-20-C-c}
+\indexentry{foo}{V-i-10-C-c}
+\indexentry{foo}{V-i-20-C-c}
+\indexentry{foo}{X-i-10-C-c}
+\indexentry{foo}{X-i-20-C-c}
+\indexentry{foo}{L-i-10-C-c}
+\indexentry{foo}{L-i-20-C-c}
+\indexentry{foo}{C-i-10-C-c}
+\indexentry{foo}{C-i-20-C-c}
+\indexentry{foo}{D-i-10-C-c}
+\indexentry{foo}{D-i-20-C-c}
+\indexentry{foo}{M-i-10-C-c}
+\indexentry{foo}{M-i-20-C-c}
+
+\indexentry{bar}{I-i-10-C-c}
+\indexentry{bar}{I-i-20-C-c}
+\indexentry{bar}{I-ii-10-C-c}
+\indexentry{bar}{I-ii-20-C-c}
+\indexentry{bar}{I-iii-10-C-c}
+\indexentry{bar}{I-iii-20-C-c}
+\indexentry{bar}{I-v-10-C-c}
+\indexentry{bar}{I-v-20-C-c}
+\indexentry{bar}{I-x-10-C-c}
+\indexentry{bar}{I-x-20-C-c}
+\indexentry{bar}{I-l-10-C-c}
+\indexentry{bar}{I-l-20-C-c}
+\indexentry{bar}{I-c-10-C-c}
+\indexentry{bar}{I-c-20-C-c}
+\indexentry{bar}{I-d-10-C-c}
+\indexentry{bar}{I-d-20-C-c}
+\indexentry{bar}{I-m-10-C-c}
+\indexentry{bar}{I-m-20-C-c}
+
+\indexentry{baz}{I-i-10-A-c}
+\indexentry{baz}{I-i-20-A-c}
+\indexentry{baz}{I-i-10-B-c}
+\indexentry{baz}{I-i-20-B-c}
+\indexentry{baz}{I-i-10-C-c}
+\indexentry{baz}{I-i-20-C-c}
+\indexentry{baz}{I-i-10-D-c}
+\indexentry{baz}{I-i-20-D-c}
+\indexentry{baz}{I-i-10-I-c}
+\indexentry{baz}{I-i-20-I-c}
+\indexentry{baz}{I-i-10-L-c}
+\indexentry{baz}{I-i-20-L-c}
+\indexentry{baz}{I-i-10-M-c}
+\indexentry{baz}{I-i-20-M-c}
+\indexentry{baz}{I-i-10-V-c}
+\indexentry{baz}{I-i-20-V-c}
+\indexentry{baz}{I-i-10-X-c}
+\indexentry{baz}{I-i-20-X-c}
+
+\indexentry{qux}{I-i-10-C-a}
+\indexentry{qux}{I-i-20-C-a}
+\indexentry{qux}{I-i-10-C-b}
+\indexentry{qux}{I-i-20-C-b}
+\indexentry{qux}{I-i-10-C-c}
+\indexentry{qux}{I-i-20-C-c}
+\indexentry{qux}{I-i-10-C-d}
+\indexentry{qux}{I-i-20-C-d}
+\indexentry{qux}{I-i-10-C-i}
+\indexentry{qux}{I-i-20-C-i}
+\indexentry{qux}{I-i-10-C-l}
+\indexentry{qux}{I-i-20-C-l}
+\indexentry{qux}{I-i-10-C-m}
+\indexentry{qux}{I-i-20-C-m}
+\indexentry{qux}{I-i-10-C-v}
+\indexentry{qux}{I-i-20-C-v}
+\indexentry{qux}{I-i-10-C-x}
+\indexentry{qux}{I-i-20-C-x}
+
diff --git a/Build/source/texk/upmendex/tests/romalpD-5.ind b/Build/source/texk/upmendex/tests/romalpD-5.ind
new file mode 100644
index 00000000000..f85a08325dd
--- /dev/null
+++ b/Build/source/texk/upmendex/tests/romalpD-5.ind
@@ -0,0 +1,9 @@
+\begin{theindex}
+
+ \item bar, 1--3, c, d, i, l, m, v, x, I, V, X, L, C, D, M
+
+ \indexspace
+
+ \item foo, i, v, x, l, c, d, m, 1--3, C, D, I, L, M, V, X
+
+\end{theindex}
diff --git a/Build/source/texk/upmendex/tests/romalpD-6.ind b/Build/source/texk/upmendex/tests/romalpD-6.ind
new file mode 100644
index 00000000000..7514b219478
--- /dev/null
+++ b/Build/source/texk/upmendex/tests/romalpD-6.ind
@@ -0,0 +1,9 @@
+\begin{theindex}
+
+ \item bar, i, v, x, l, c, d, m, 1--3, I, V, X, L, C, D, M
+
+ \indexspace
+
+ \item foo, i, v, x, l, c, d, m, 1--3, I, V, X, L, C, D, M
+
+\end{theindex}
diff --git a/Build/source/texk/upmendex/tests/romalpD-7.ind b/Build/source/texk/upmendex/tests/romalpD-7.ind
new file mode 100644
index 00000000000..779a39c4ffb
--- /dev/null
+++ b/Build/source/texk/upmendex/tests/romalpD-7.ind
@@ -0,0 +1,9 @@
+\begin{theindex}
+
+ \item bar, 1--3, c, d, i, l, m, v, x, C, D, I, L, M, V, X
+
+ \indexspace
+
+ \item foo, 1--3, c, d, i, l, m, v, x, C, D, I, L, M, V, X
+
+\end{theindex}
diff --git a/Build/source/texk/upmendex/tests/romalpD.idx b/Build/source/texk/upmendex/tests/romalpD.idx
new file mode 100644
index 00000000000..3247aefbf79
--- /dev/null
+++ b/Build/source/texk/upmendex/tests/romalpD.idx
@@ -0,0 +1,35 @@
+\indexentry{foo}{1}
+\indexentry{foo}{2}
+\indexentry{foo}{3}
+\indexentry{foo}{C}
+\indexentry{foo}{D}
+\indexentry{foo}{I}
+\indexentry{foo}{L}
+\indexentry{foo}{M}
+\indexentry{foo}{V}
+\indexentry{foo}{X}
+\indexentry{foo}{i}
+\indexentry{foo}{v}
+\indexentry{foo}{x}
+\indexentry{foo}{l}
+\indexentry{foo}{c}
+\indexentry{foo}{d}
+\indexentry{foo}{m}
+
+\indexentry{bar}{1}
+\indexentry{bar}{2}
+\indexentry{bar}{3}
+\indexentry{bar}{I}
+\indexentry{bar}{V}
+\indexentry{bar}{X}
+\indexentry{bar}{L}
+\indexentry{bar}{C}
+\indexentry{bar}{D}
+\indexentry{bar}{M}
+\indexentry{bar}{c}
+\indexentry{bar}{d}
+\indexentry{bar}{i}
+\indexentry{bar}{l}
+\indexentry{bar}{m}
+\indexentry{bar}{v}
+\indexentry{bar}{x}
diff --git a/Build/source/texk/upmendex/tests/upmendex.test b/Build/source/texk/upmendex/tests/upmendex.test
index 6a5d935a0ae..0eef034cadc 100755
--- a/Build/source/texk/upmendex/tests/upmendex.test
+++ b/Build/source/texk/upmendex/tests/upmendex.test
@@ -1,89 +1,103 @@
#! /bin/sh -vx
# $Id$
-# Copyright 2017 Karl Berry <tex-live@tug.org>
+# Copyright 2017-2022 Karl Berry <tex-live@tug.org>
# Copyright 2013 Peter Breitenlohner <tex-live@tug.org>
# You may freely use, modify and/or distribute this file.
TEXMFCNF=$srcdir/../kpathsea
export TEXMFCNF
-rm -f foo.* uni.* range*.* pprec*.* locale*.* attr*.* rule*.*
+rm -f foo.* uni.* range*.* pprec*.* romalp*.* locale*.* attr*.* rule*.*
+rc=0
./upmendex $srcdir/tests/foo.idx -o foo.ind1 -t foo.ilg1 \
- && diff $srcdir/tests/foo.ind foo.ind1 || exit 1
+ && diff $srcdir/tests/foo.ind foo.ind1 || rc=1
cat $srcdir/tests/foo.idx | ./upmendex >foo.ind2 2>foo.ilg2 \
- && diff $srcdir/tests/foo.ind foo.ind2 || exit 1
+ && diff $srcdir/tests/foo.ind foo.ind2 || rc=2
./upmendex -d $srcdir/tests/uni.dict -s $srcdir/tests/uni.ist \
$srcdir/tests/uni.idx -o uni.ind1 -t uni.ilg1 \
- && diff $srcdir/tests/uni.ind uni.ind1 || exit 1
+ && diff $srcdir/tests/uni.ind uni.ind1 || rc=3
cat $srcdir/tests/uni.idx | \
./upmendex -d $srcdir/tests/uni.dict -s $srcdir/tests/uni.ist \
>uni.ind2 2>uni.ilg2 \
- && diff $srcdir/tests/uni.ind uni.ind2 || exit 1
+ && diff $srcdir/tests/uni.ind uni.ind2 || rc=4
./upmendex -d $srcdir/tests/uni.dict -s $srcdir/tests/uni1.ist -s $srcdir/tests/uni2.ist \
$srcdir/tests/uni.idx -o uni.ind3 -t uni.ilg3 \
- && diff $srcdir/tests/uni.ind uni.ind3 || exit 1
+ && diff $srcdir/tests/uni.ind uni.ind3 || rc=5
-# test for range suffix_2p, suffix_3p, suffix_mp
-./upmendex -s $srcdir/tests/range1.ist $srcdir/tests/range.idx \
- -o range1.ind1 -t range1.ilg \
- && diff $srcdir/tests/range1.ind range1.ind1 || exit 1
-./upmendex -s $srcdir/tests/range2.ist $srcdir/tests/range.idx \
- -o range2.ind1 -t range2.ilg \
- && diff $srcdir/tests/range2.ind range2.ind1 || exit 1
+# test for range suffix_2p, suffix_3p, suffix_mp
+for num in 1 2 3; do
+./upmendex -s $srcdir/tests/range$num.ist $srcdir/tests/range.idx \
+ -o range$num.ind1 -t range$num.ilg \
+ && diff $srcdir/tests/range$num.ind range$num.ind1 || rc=6
+done
-./upmendex -s $srcdir/tests/range3.ist $srcdir/tests/range.idx \
- -o range3.ind1 -t range3.ilg \
- && diff $srcdir/tests/range3.ind range3.ind1 || exit 1
# test for page_precedence and suffix_3p
-./upmendex -s $srcdir/tests/pprec0.ist $srcdir/tests/pprecA.idx \
- -o pprecA-0.ind1 -t pprecA-0.ilg \
- && diff $srcdir/tests/pprecA-0.ind pprecA-0.ind1 || exit 1
-
-./upmendex -s $srcdir/tests/pprec1.ist $srcdir/tests/pprecA.idx \
- -o pprecA-1.ind1 -t pprecA-1.ilg \
- && diff $srcdir/tests/pprecA-1.ind pprecA-1.ind1 || exit 1
-
-./upmendex -s $srcdir/tests/pprec2.ist $srcdir/tests/pprecA.idx \
- -o pprecA-2.ind1 -t pprecA-2.ilg \
- && diff $srcdir/tests/pprecA-2.ind pprecA-2.ind1 || exit 1
+sfx=A
+for num in 0 1 2; do
+./upmendex -s $srcdir/tests/pprec$num.ist $srcdir/tests/pprec$sfx.idx \
+ -o pprec$sfx-$num.ind1 -t pprec$sfx-$num.ilg \
+ && diff $srcdir/tests/pprec$sfx-$num.ind pprec$sfx-$num.ind1 || rc=7
+done
+sfx=B
+for num in 0 3 4; do
+./upmendex -s $srcdir/tests/pprec$num.ist $srcdir/tests/pprec$sfx.idx \
+ -o pprec$sfx-$num.ind1 -t pprec$sfx-$num.ilg \
+ && diff $srcdir/tests/pprec$sfx-$num.ind pprec$sfx-$num.ind1 || rc=8
+done
+
+
+# test for page_precedence, heuristic detection if a letter is Roman or Alpha
+sfx=A
+for num in 5 6; do
+./upmendex -s $srcdir/tests/pprec$num.ist $srcdir/tests/romalp$sfx.idx \
+ -o romalp$sfx-$num.ind1 -t romalp$sfx-$num.ilg \
+ && diff $srcdir/tests/romalp$sfx-$num.ind romalp$sfx-$num.ind1 || rc=9
+done
+sfx=B
+for num in 5 6 7; do
+./upmendex -s $srcdir/tests/pprec$num.ist $srcdir/tests/romalp$sfx.idx \
+ -o romalp$sfx-$num.ind1 -t romalp$sfx-$num.ilg \
+ && diff $srcdir/tests/romalp$sfx-$num.ind romalp$sfx-$num.ind1 || rc=10
+done
+sfx=C
+for num in 5; do
+./upmendex -s $srcdir/tests/pprec$num.ist $srcdir/tests/romalp$sfx.idx \
+ -o romalp$sfx-$num.ind1 -t romalp$sfx-$num.ilg \
+ && diff $srcdir/tests/romalp$sfx-$num.ind romalp$sfx-$num.ind1 || rc=11
+done
+sfx=D
+for num in 5 6 7; do
+./upmendex -s $srcdir/tests/pprec$num.ist $srcdir/tests/romalp$sfx.idx \
+ -o romalp$sfx-$num.ind1 -t romalp$sfx-$num.ilg \
+ && diff $srcdir/tests/romalp$sfx-$num.ind romalp$sfx-$num.ind1 || rc=12
+done
-./upmendex -s $srcdir/tests/pprec0.ist $srcdir/tests/pprecB.idx \
- -o pprecB-0.ind1 -t pprecB-0.ilg \
- && diff $srcdir/tests/pprecB-0.ind pprecB-0.ind1 || exit 1
-
-./upmendex -s $srcdir/tests/pprec3.ist $srcdir/tests/pprecB.idx \
- -o pprecB-3.ind1 -t pprecB-3.ilg \
- && diff $srcdir/tests/pprecB-3.ind pprecB-3.ind1 || exit 1
-
-./upmendex -s $srcdir/tests/pprec4.ist $srcdir/tests/pprecB.idx \
- -o pprecB-4.ind1 -t pprecB-4.ilg \
- && diff $srcdir/tests/pprecB-4.ind pprecB-4.ind1 || exit 1
# test for icu_locale
./upmendex -s $srcdir/tests/uni.ist -s $srcdir/tests/locale1.ist $srcdir/tests/rule.idx \
-o locale1.ind1 -t locale1.ilg \
- && diff $srcdir/tests/locale1.ind locale1.ind1 || exit 1
+ && diff $srcdir/tests/locale1.ind locale1.ind1 || rc=51
# test for icu_attributes
./upmendex -s $srcdir/tests/uni.ist -s $srcdir/tests/attr1.ist $srcdir/tests/rule.idx \
-o attr1.ind1 -t attr1.ilg \
- && diff $srcdir/tests/attr1.ind attr1.ind1 || exit 1
+ && diff $srcdir/tests/attr1.ind attr1.ind1 || rc=52
# test for icu_rules
./upmendex -s $srcdir/tests/uni.ist -s $srcdir/tests/rule1.ist $srcdir/tests/rule.idx \
-o rule1.ind1 -t rule1.ilg \
- && diff $srcdir/tests/rule.ind rule1.ind1 || exit 1
+ && diff $srcdir/tests/rule.ind rule1.ind1 || rc=53
./upmendex -s $srcdir/tests/uni.ist -s $srcdir/tests/rule2.ist $srcdir/tests/rule.idx \
-o rule2.ind1 -t rule2.ilg \
- && diff $srcdir/tests/rule.ind rule2.ind1 || exit 1
+ && diff $srcdir/tests/rule.ind rule2.ind1 || rc=54
# malformed input
./upmendex -s $srcdir/tests/uni.ist -s $srcdir/tests/rule3.ist $srcdir/tests/rule.idx \
@@ -107,4 +121,7 @@ fi
# test for icu_locale + icu_rules
./upmendex -s $srcdir/tests/uni.ist -s $srcdir/tests/locale2.ist -s $srcdir/tests/rule1.ist $srcdir/tests/rule.idx \
-o locale2-rule1.ind1 -t locale2-rule1.ilg \
- && diff $srcdir/tests/locale2-rule.ind locale2-rule1.ind1 || exit 1
+ && diff $srcdir/tests/locale2-rule.ind locale2-rule1.ind1 || rc=55
+
+
+exit $rc