test(witness): the JSON role map sees mml:math and figcaption (H3, red)

PM measured it on N200 Vegbygging:2024: 74 `mml:math` carrying 2 811
characters and 49 `figcaption`, and the witness counted 0 and 0. Two
independent causes and both are in this red:

- `count_sts_xml` takes every tag through `_local`, which strips a
  Clark-notation namespace AND a prefix; `count_sts_json` compared the
  raw string, so `mml:math` never reached `tag == "math"`.
- the publisher's JSON puts a figure's caption in `figcaption` under
  the `graphic`, not in the `fig/caption` NISO-STS writes. Measured
  over the eight deliveries on this machine: 430 `figcaption`.

Three tests. The JSON half of `sts-rikt.xml`'s family carries both
shapes as a committed fixture; the real N200 carries PM's four numbers
and skips where the corpus is absent; and the known-negative for
stripping a prefix is N101's 574 `tbx:` tags, whose local names name
no role -- a generalising rule measured against what it must NOT take.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Kjell Tore Guttormsen 2026-09-19 05:54:01 +02:00
commit 37599a3758
Signed by: ktg
SSH key fingerprint: SHA256:JakMjO6FTBBzN0Bhfj9saOoEjaFxlSdYuZQQpM/lF9Q
2 changed files with 76 additions and 0 deletions

View file

@ -0,0 +1,37 @@
{
"productInfo": {"meta": {"productTitle": "Formula and figure caption"}},
"standardContent": {
"id": null, "tag": "#document", "a": {},
"c": [
{"e": 1, "t": null, "x": {"id": null, "tag": "standard", "a": {}, "c": [
{"e": 1, "t": null, "x": {"id": null, "tag": "body", "a": {}, "c": [
{"e": 1, "t": null, "x": {"id": null, "tag": "sec", "a": {}, "c": [
{"e": 1, "t": null, "x": {"id": null, "tag": "title", "a": {}, "c": [
{"e": 2, "t": "Vegdekker", "x": null}
]}},
{"e": 1, "t": null, "x": {"id": null, "tag": "p", "a": {}, "c": [
{"e": 2, "t": "Kravet regnes som ", "x": null},
{"e": 1, "t": null, "x": {"id": null, "tag": "inline-formula", "a": {}, "c": [
{"e": 1, "t": null, "x": {"id": null, "tag": "mml:math", "a": {}, "c": [
{"e": 2, "t": "IRI < 2", "x": null}
]}}
]}}
]}},
{"e": 1, "t": null, "x": {"id": null, "tag": "fig", "a": {}, "c": [
{"e": 1, "t": null, "x": {"id": null, "tag": "graphic", "a": {"href": "figur-85-1.png"}, "c": [
{"e": 1, "t": null, "x": {"id": null, "tag": "figcaption", "a": {}, "c": [
{"e": 1, "t": null, "x": {"id": null, "tag": "graphic-caption-label", "a": {}, "c": [
{"e": 2, "t": "Figur 85-1", "x": null}
]}},
{"e": 1, "t": null, "x": {"id": null, "tag": "graphic-caption-title", "a": {}, "c": [
{"e": 2, "t": "Maalepunkter langs vegbanen.", "x": null}
]}}
]}}
]}}
]}}
]}}
]}}
]}}
]
}
}