summaryrefslogtreecommitdiff
path: root/Build/source
diff options
context:
space:
mode:
authorTakuji Tanaka <ttk@t-lab.opal.ne.jp>2022-05-22 12:54:25 +0000
committerTakuji Tanaka <ttk@t-lab.opal.ne.jp>2022-05-22 12:54:25 +0000
commit387205a83ab959e03fb537fc33d12650d09e3695 (patch)
treeb8dcfa3fc0d6c26d68c34b0c138b10d75c35ac98 /Build/source
parentca18c962f63ce9d55873266c577f8bc909088174 (diff)
mendex: Improve heuristic detection of page number types
git-svn-id: svn://tug.org/texlive/trunk@63362 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
-rw-r--r--Build/source/texk/mendexk/ChangeLog11
-rw-r--r--Build/source/texk/mendexk/Makefile.am17
-rw-r--r--Build/source/texk/mendexk/Makefile.in18
-rw-r--r--Build/source/texk/mendexk/fread.c24
-rwxr-xr-xBuild/source/texk/mendexk/tests/mendex.test97
-rw-r--r--Build/source/texk/mendexk/tests/pprec5.ist3
-rw-r--r--Build/source/texk/mendexk/tests/pprec6.ist3
-rw-r--r--Build/source/texk/mendexk/tests/pprec7.ist3
-rw-r--r--Build/source/texk/mendexk/tests/romalpA-5.ind5
-rw-r--r--Build/source/texk/mendexk/tests/romalpA-6.ind5
-rw-r--r--Build/source/texk/mendexk/tests/romalpA.idx7
-rw-r--r--Build/source/texk/mendexk/tests/romalpB-5.ind14
-rw-r--r--Build/source/texk/mendexk/tests/romalpB-6.ind14
-rw-r--r--Build/source/texk/mendexk/tests/romalpB-7.ind14
-rw-r--r--Build/source/texk/mendexk/tests/romalpB.idx60
-rw-r--r--Build/source/texk/mendexk/tests/romalpC-5.ind14
-rw-r--r--Build/source/texk/mendexk/tests/romalpC.idx76
-rw-r--r--Build/source/texk/mendexk/tests/romalpD-5.ind9
-rw-r--r--Build/source/texk/mendexk/tests/romalpD-6.ind9
-rw-r--r--Build/source/texk/mendexk/tests/romalpD-7.ind9
-rw-r--r--Build/source/texk/mendexk/tests/romalpD.idx35
-rw-r--r--Build/source/texk/mendexk/version.h2
22 files changed, 390 insertions, 59 deletions
diff --git a/Build/source/texk/mendexk/ChangeLog b/Build/source/texk/mendexk/ChangeLog
index dd888d4309b..e6baf5d0a4f 100644
--- a/Build/source/texk/mendexk/ChangeLog
+++ b/Build/source/texk/mendexk/ChangeLog
@@ -1,3 +1,14 @@
+2022-05-22 TANAKA Takuji <ttk@t-lab.opal.ne.jp>
+
+ * fread.c:
+ Modify heuristic detection of page number types
+ for ambiguous ones between roman number and alphabet.
+ * tests/mendex.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.
+ * version.h: Date [22-May-2022]
+
2022-03-21 Karl Berry <karl@tug.org>
* TL'22 release.
diff --git a/Build/source/texk/mendexk/Makefile.am b/Build/source/texk/mendexk/Makefile.am
index d3f6c148c28..98af536b713 100644
--- a/Build/source/texk/mendexk/Makefile.am
+++ b/Build/source/texk/mendexk/Makefile.am
@@ -57,8 +57,17 @@ EXTRA_DIST += $(TESTS)
## tests/mendex.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*.*
diff --git a/Build/source/texk/mendexk/Makefile.in b/Build/source/texk/mendexk/Makefile.in
index a08952f90c6..d9c7c2a73ee 100644
--- a/Build/source/texk/mendexk/Makefile.in
+++ b/Build/source/texk/mendexk/Makefile.in
@@ -582,11 +582,21 @@ dist_man1_MANS = mendex.1
EXTRA_DIST = COPYRIGHT COPYRIGHT.ja ChangeLog.ja indexsty \
mendex.ja.txt mendex.1 mendex.1.ja $(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 = tests/mendex.test
-DISTCLEANFILES = foo.* uni.* pprec*.*
+DISTCLEANFILES = foo.* uni.* range*.* pprec*.* romalp*.*
all: c-auto.h
$(MAKE) $(AM_MAKEFLAGS) all-am
diff --git a/Build/source/texk/mendexk/fread.c b/Build/source/texk/mendexk/fread.c
index 0dfad459896..3da7132fb7b 100644
--- a/Build/source/texk/mendexk/fread.c
+++ b/Build/source/texk/mendexk/fread.c
@@ -458,6 +458,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);
@@ -501,23 +502,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;
@@ -526,29 +529,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;
@@ -557,6 +562,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/mendexk/tests/mendex.test b/Build/source/texk/mendexk/tests/mendex.test
index f7556555ea9..2aa11afd633 100755
--- a/Build/source/texk/mendexk/tests/mendex.test
+++ b/Build/source/texk/mendexk/tests/mendex.test
@@ -1,68 +1,83 @@
#! /bin/sh -vx
# $Id$
-# Copyright 2017-2021 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*.*
+rm -f foo.* uni.* range*.* pprec*.* romalp*.*
+rc=0
./mendex $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 | ./mendex >foo.ind2 2>foo.ilg2 \
- && diff $srcdir/tests/foo.ind foo.ind2 || exit 1
+ && diff $srcdir/tests/foo.ind foo.ind2 || rc=2
./mendex -U -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 | \
./mendex -U -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
./mendex -U -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
-./mendex -s $srcdir/tests/range1.ist $srcdir/tests/range.idx \
- -o range1.ind1 -t range1.ilg \
- && diff $srcdir/tests/range1.ind range1.ind1 || exit 1
-./mendex -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
+./mendex -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
-./mendex -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
-./mendex -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
-
-./mendex -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
-
-./mendex -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
-
-./mendex -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
-
-./mendex -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
-
-./mendex -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
-
+sfx=A
+for num in 0 1 2; do
+./mendex -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
+./mendex -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
+./mendex -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
+./mendex -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
+./mendex -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
+./mendex -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
+
+
+exit $rc
diff --git a/Build/source/texk/mendexk/tests/pprec5.ist b/Build/source/texk/mendexk/tests/pprec5.ist
new file mode 100644
index 00000000000..400d70c7862
--- /dev/null
+++ b/Build/source/texk/mendexk/tests/pprec5.ist
@@ -0,0 +1,3 @@
+% page_precedence "rnaRA"
+
+line_max 299
diff --git a/Build/source/texk/mendexk/tests/pprec6.ist b/Build/source/texk/mendexk/tests/pprec6.ist
new file mode 100644
index 00000000000..5463ac25a46
--- /dev/null
+++ b/Build/source/texk/mendexk/tests/pprec6.ist
@@ -0,0 +1,3 @@
+page_precedence "rnR"
+
+line_max 299
diff --git a/Build/source/texk/mendexk/tests/pprec7.ist b/Build/source/texk/mendexk/tests/pprec7.ist
new file mode 100644
index 00000000000..f600c5b230f
--- /dev/null
+++ b/Build/source/texk/mendexk/tests/pprec7.ist
@@ -0,0 +1,3 @@
+page_precedence "naA"
+
+line_max 299
diff --git a/Build/source/texk/mendexk/tests/romalpA-5.ind b/Build/source/texk/mendexk/tests/romalpA-5.ind
new file mode 100644
index 00000000000..fd0b0ec4490
--- /dev/null
+++ b/Build/source/texk/mendexk/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/mendexk/tests/romalpA-6.ind b/Build/source/texk/mendexk/tests/romalpA-6.ind
new file mode 100644
index 00000000000..fd0b0ec4490
--- /dev/null
+++ b/Build/source/texk/mendexk/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/mendexk/tests/romalpA.idx b/Build/source/texk/mendexk/tests/romalpA.idx
new file mode 100644
index 00000000000..03b0646678b
--- /dev/null
+++ b/Build/source/texk/mendexk/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/mendexk/tests/romalpB-5.ind b/Build/source/texk/mendexk/tests/romalpB-5.ind
new file mode 100644
index 00000000000..de3d9903bb8
--- /dev/null
+++ b/Build/source/texk/mendexk/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/mendexk/tests/romalpB-6.ind b/Build/source/texk/mendexk/tests/romalpB-6.ind
new file mode 100644
index 00000000000..b5d7d040b54
--- /dev/null
+++ b/Build/source/texk/mendexk/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/mendexk/tests/romalpB-7.ind b/Build/source/texk/mendexk/tests/romalpB-7.ind
new file mode 100644
index 00000000000..f65c311dfe4
--- /dev/null
+++ b/Build/source/texk/mendexk/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/mendexk/tests/romalpB.idx b/Build/source/texk/mendexk/tests/romalpB.idx
new file mode 100644
index 00000000000..a56460db3b7
--- /dev/null
+++ b/Build/source/texk/mendexk/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/mendexk/tests/romalpC-5.ind b/Build/source/texk/mendexk/tests/romalpC-5.ind
new file mode 100644
index 00000000000..2edc90d1ef9
--- /dev/null
+++ b/Build/source/texk/mendexk/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/mendexk/tests/romalpC.idx b/Build/source/texk/mendexk/tests/romalpC.idx
new file mode 100644
index 00000000000..208686338a6
--- /dev/null
+++ b/Build/source/texk/mendexk/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/mendexk/tests/romalpD-5.ind b/Build/source/texk/mendexk/tests/romalpD-5.ind
new file mode 100644
index 00000000000..f85a08325dd
--- /dev/null
+++ b/Build/source/texk/mendexk/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/mendexk/tests/romalpD-6.ind b/Build/source/texk/mendexk/tests/romalpD-6.ind
new file mode 100644
index 00000000000..7514b219478
--- /dev/null
+++ b/Build/source/texk/mendexk/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/mendexk/tests/romalpD-7.ind b/Build/source/texk/mendexk/tests/romalpD-7.ind
new file mode 100644
index 00000000000..779a39c4ffb
--- /dev/null
+++ b/Build/source/texk/mendexk/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/mendexk/tests/romalpD.idx b/Build/source/texk/mendexk/tests/romalpD.idx
new file mode 100644
index 00000000000..3247aefbf79
--- /dev/null
+++ b/Build/source/texk/mendexk/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/mendexk/version.h b/Build/source/texk/mendexk/version.h
index f61d504deb7..b54fe49039c 100644
--- a/Build/source/texk/mendexk/version.h
+++ b/Build/source/texk/mendexk/version.h
@@ -1,2 +1,2 @@
-#define VERSION "version " PACKAGE_VERSION " [19-Sep-2021]"
+#define VERSION "version " PACKAGE_VERSION " [22-May-2022]"
#define BUG_ADDRESS "issue@texjp.org"