pubid 2.0.5 → 2.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/data/parg/bipm.json +1 -1
- data/data/parg/bipm.parg +290 -0
- data/lib/pubid/bipm/CLAUDE.md +2 -0
- data/lib/pubid/bipm/builder.rb +26 -1
- data/lib/pubid/bipm/identifiers/committee_document.rb +13 -1
- data/lib/pubid/bipm/renderer.rb +18 -3
- data/lib/pubid/bipm/urn_generator.rb +14 -1
- data/lib/pubid/bipm/urn_parser.rb +14 -1
- data/lib/pubid/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a55050f14ad3cf19fd2e3d3a00faf0d2258cf761d71515716cdf61a172ce0484
|
|
4
|
+
data.tar.gz: 9c150c6b494788ad7b3f158ed0bd9132d8ae970089e182d9f5cef7885d22a7de
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 665bddc99ab7da91c7f67c045655b0b55ef86b500469efdca15a7215ec89479f1fa0c1046fbad88ea3683ed664a3c6d01d54a6fe4800d681ec1b758d73b5b01f
|
|
7
|
+
data.tar.gz: 6fada1851bb8adbbc936ca69167336f6ddd88dfcce72dbeeb9a73a035449547a8cd6324d5b1240ed3aaa71ddadceb9dff89d5efe22e9f62df0a775055f4110f0
|
data/data/parg/bipm.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"bindings":null,"version":"0.1.0","grammar":"PubidBipm","shape":"parsanol-tree/v2","binding_version":1,"entries":{"identifier":{"root":"identifier","grammar":{"atoms":[{"Entity":{"atom":30}},{"Str":{"pattern":"Metrologia"}},{"Entity":{"atom":3}},{"Str":{"pattern":" "}},{"Entity":{"atom":5}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":4,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"volume","atom":6}},{"Entity":{"atom":3}},{"Entity":{"atom":5}},{"Entity":{"atom":13}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Alternative":{"atoms":[11,12]}},{"Alternative":{"atoms":[9,10]}},{"Repetition":{"atom":14,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"issue","atom":15}},{"Entity":{"atom":3}},{"Entity":{"atom":5}},{"Entity":{"atom":13}},{"Alternative":{"atoms":[18,19]}},{"Repetition":{"atom":20,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"article","atom":21}},{"Sequence":{"atoms":[17,22]}},{"Repetition":{"atom":23,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[8,16,24]}},{"Repetition":{"atom":25,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[2,7,26]}},{"Repetition":{"atom":27,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[1,28]}},{"Named":{"name":"metrologia","atom":29}},{"Entity":{"atom":79}},{"Str":{"pattern":"BIPM SI Brochure"}},{"Str":{"pattern":"SI Brochure"}},{"Alternative":{"atoms":[32,33]}},{"Entity":{"atom":3}},{"Str":{"pattern":"sur le SI"}},{"Entity":{"atom":3}},{"Sequence":{"atoms":[36,37]}},{"Repetition":{"atom":38,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":45}},{"Entity":{"atom":5}},{"Repetition":{"atom":41,"min":1,"max":null,"tag":"Repetition"}},{"Str":{"pattern":"e"}},{"Sequence":{"atoms":[42,43]}},{"Named":{"name":"edition","atom":44}},{"Entity":{"atom":3}},{"Entity":{"atom":55}},{"Str":{"pattern":"v"}},{"Entity":{"atom":5}},{"Entity":{"atom":51}},{"Str":{"pattern":"."}},{"Alternative":{"atoms":[49,50]}},{"Repetition":{"atom":52,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[48,53]}},{"Named":{"name":"version","atom":54}},{"Entity":{"atom":3}},{"Str":{"pattern":"("}},{"Entity":{"atom":68}},{"Entity":{"atom":5}},{"Repetition":{"atom":59,"min":1,"max":null,"tag":"Repetition"}},{"Entity":{"atom":62}},{"Str":{"pattern":"/"}},{"Entity":{"atom":5}},{"Repetition":{"atom":63,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[61,64]}},{"Repetition":{"atom":65,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[60,66]}},{"Named":{"name":"years","atom":67}},{"Str":{"pattern":", "}},{"Entity":{"atom":76}},{"Str":{"pattern":"EN"}},{"Str":{"pattern":"FR"}},{"Re":{"pattern":"[E]"}},{"Re":{"pattern":"[F]"}},{"Alternative":{"atoms":[71,72,73,74]}},{"Named":{"name":"language","atom":75}},{"Str":{"pattern":")"}},{"Sequence":{"atoms":[34,35,39,40,46,47,56,57,58,69,70,77]}},{"Named":{"name":"si_brochure","atom":78}},{"Entity":{"atom":96}},{"Str":{"pattern":"BIPM SI Brochure"}},{"Str":{"pattern":"SI Brochure"}},{"Alternative":{"atoms":[81,82]}},{"Entity":{"atom":3}},{"Entity":{"atom":94}},{"Str":{"pattern":"Appendix"}},{"Entity":{"atom":3}},{"Entity":{"atom":5}},{"Repetition":{"atom":88,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[86,87,89]}},{"Str":{"pattern":"Concise"}},{"Str":{"pattern":"FAQ"}},{"Alternative":{"atoms":[90,91,92]}},{"Named":{"name":"variant","atom":93}},{"Sequence":{"atoms":[83,84,85]}},{"Named":{"name":"si_brochure_variant","atom":95}},{"Entity":{"atom":110}},{"Str":{"pattern":"BIPM SI Brochure"}},{"Str":{"pattern":"SI Brochure"}},{"Alternative":{"atoms":[98,99]}},{"Entity":{"atom":3}},{"Str":{"pattern":"Part"}},{"Entity":{"atom":3}},{"Entity":{"atom":5}},{"Repetition":{"atom":104,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"part","atom":105}},{"Sequence":{"atoms":[101,102,103,106]}},{"Repetition":{"atom":107,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[100,108]}},{"Named":{"name":"si_brochure_section","atom":109}},{"Entity":{"atom":168}},{"Str":{"pattern":"BIPM"}},{"Entity":{"atom":3}},{"Entity":{"atom":136}},{"Str":{"pattern":"SI MEP"}},{"Entity":{"atom":3}},{"Entity":{"atom":122}},{"Entity":{"atom":5}},{"Entity":{"atom":13}},{"Alternative":{"atoms":[118,119]}},{"Repetition":{"atom":120,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"mep_code","atom":121}},{"Sequence":{"atoms":[115,116,117]}},{"Str":{"pattern":"Rapport"}},{"Entity":{"atom":3}},{"Entity":{"atom":134}},{"Str":{"pattern":"BIPM-"}},{"Entity":{"atom":5}},{"Repetition":{"atom":128,"min":1,"max":null,"tag":"Repetition"}},{"Entity":{"atom":62}},{"Entity":{"atom":5}},{"Repetition":{"atom":131,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[127,129,130,132]}},{"Named":{"name":"report_code","atom":133}},{"Sequence":{"atoms":[124,125,126]}},{"Alternative":{"atoms":[123,135]}},{"Entity":{"atom":3}},{"Entity":{"atom":164}},{"Str":{"pattern":"Appendix"}},{"Entity":{"atom":3}},{"Entity":{"atom":5}},{"Repetition":{"atom":141,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"appendix","atom":142}},{"Entity":{"atom":3}},{"Str":{"pattern":"Annex"}},{"Entity":{"atom":3}},{"Entity":{"atom":5}},{"Repetition":{"atom":147,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"annex","atom":148}},{"Sequence":{"atoms":[144,145,146,149]}},{"Repetition":{"atom":150,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":3}},{"Str":{"pattern":"Part"}},{"Entity":{"atom":3}},{"Entity":{"atom":5}},{"Repetition":{"atom":155,"min":1,"max":null,"tag":"Repetition"}},{"Entity":{"atom":51}},{"Entity":{"atom":5}},{"Repetition":{"atom":158,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[157,159]}},{"Repetition":{"atom":160,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[156,161]}},{"Named":{"name":"part","atom":162}},{"Sequence":{"atoms":[139,140,143,151,152,153,154,163]}},{"Sequence":{"atoms":[112,113,114,137,138]}},{"Entity":{"atom":136}},{"Alternative":{"atoms":[165,166]}},{"Named":{"name":"mep","atom":167}},{"Entity":{"atom":208}},{"Str":{"pattern":"BIPM"}},{"Entity":{"atom":3}},{"Entity":{"atom":202}},{"Entity":{"atom":189}},{"Str":{"pattern":"CCAUV"}},{"Str":{"pattern":"CCDS"}},{"Str":{"pattern":"CCEM"}},{"Str":{"pattern":"CCPR"}},{"Str":{"pattern":"CCQM"}},{"Str":{"pattern":"CCRI"}},{"Str":{"pattern":"CCTF"}},{"Str":{"pattern":"CGPM"}},{"Str":{"pattern":"CIPM"}},{"Str":{"pattern":"JCRB"}},{"Str":{"pattern":"CCL"}},{"Str":{"pattern":"CCM"}},{"Str":{"pattern":"CCT"}},{"Str":{"pattern":"CCU"}},{"Alternative":{"atoms":[174,175,176,177,178,179,180,181,182,183,184,185,186,187]}},{"Named":{"name":"group","atom":188}},{"Str":{"pattern":"-GD-"}},{"Entity":{"atom":195}},{"Str":{"pattern":"MeP"}},{"Str":{"pattern":"RSI"}},{"Alternative":{"atoms":[192,193]}},{"Named":{"name":"guide_kind","atom":194}},{"Entity":{"atom":197}},{"Str":{"pattern":"-"}},{"Named":{"name":"dash","atom":196}},{"Entity":{"atom":5}},{"Repetition":{"atom":199,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"number","atom":200}},{"Sequence":{"atoms":[173,190,191,198,201]}},{"Entity":{"atom":3}},{"Entity":{"atom":164}},{"Sequence":{"atoms":[170,171,172,203,204]}},{"Entity":{"atom":202}},{"Alternative":{"atoms":[205,206]}},{"Named":{"name":"guide","atom":207}},{"Entity":{"atom":251}},{"Entity":{"atom":218}},{"Str":{"pattern":"Recommandation"}},{"Str":{"pattern":"Déclaration"}},{"Str":{"pattern":"Résolution"}},{"Str":{"pattern":"Statement"}},{"Str":{"pattern":"Décision"}},{"Str":{"pattern":"Action"}},{"Alternative":{"atoms":[211,212,213,214,215,216]}},{"Named":{"name":"type_word","atom":217}},{"Entity":{"atom":3}},{"Entity":{"atom":229}},{"Entity":{"atom":5}},{"Repetition":{"atom":221,"min":1,"max":null,"tag":"Repetition"}},{"Entity":{"atom":197}},{"Entity":{"atom":5}},{"Repetition":{"atom":224,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[223,225]}},{"Repetition":{"atom":226,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[222,227]}},{"Named":{"name":"number","atom":228}},{"Sequence":{"atoms":[219,220]}},{"Repetition":{"atom":230,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":3}},{"Entity":{"atom":236}},{"Str":{"pattern":"de la"}},{"Str":{"pattern":"du"}},{"Alternative":{"atoms":[234,235]}},{"Entity":{"atom":3}},{"Entity":{"atom":189}},{"Entity":{"atom":3}},{"Entity":{"atom":247}},{"Str":{"pattern":"("}},{"Entity":{"atom":245}},{"Entity":{"atom":5}},{"Repetition":{"atom":243,"min":4,"max":4,"tag":"Repetition"}},{"Named":{"name":"year","atom":244}},{"Str":{"pattern":")"}},{"Sequence":{"atoms":[241,242,246]}},{"Sequence":{"atoms":[239,240]}},{"Repetition":{"atom":248,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[210,231,232,233,237,238,249]}},{"Named":{"name":"committee_long_fr","atom":250}},{"Entity":{"atom":395}},{"Entity":{"atom":289}},{"Entity":{"atom":189}},{"Entity":{"atom":3}},{"Entity":{"atom":229}},{"Entity":{"atom":262}},{"Str":{"pattern":"st"}},{"Str":{"pattern":"nd"}},{"Str":{"pattern":"rd"}},{"Str":{"pattern":"th"}},{"Alternative":{"atoms":[258,259,260,261]}},{"Entity":{"atom":3}},{"Str":{"pattern":"Meeting"}},{"Entity":{"atom":3}},{"Entity":{"atom":274}},{"Str":{"pattern":"("}},{"Entity":{"atom":245}},{"Str":{"pattern":", "}},{"Entity":{"atom":76}},{"Sequence":{"atoms":[269,270]}},{"Repetition":{"atom":271,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":")"}},{"Sequence":{"atoms":[267,268,272,273]}},{"Sequence":{"atoms":[265,266]}},{"Repetition":{"atom":275,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[254,255,256,257,263,264,276]}},{"Entity":{"atom":189}},{"Entity":{"atom":3}},{"Str":{"pattern":"Meeting"}},{"Entity":{"atom":3}},{"Entity":{"atom":229}},{"Entity":{"atom":3}},{"Entity":{"atom":274}},{"Sequence":{"atoms":[283,284]}},{"Repetition":{"atom":285,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[278,279,280,281,282,286]}},{"Alternative":{"atoms":[277,287]}},{"Named":{"name":"meeting_en","atom":288}},{"Entity":{"atom":327}},{"Entity":{"atom":189}},{"Entity":{"atom":3}},{"Entity":{"atom":229}},{"Str":{"pattern":"<sup>e</sup>"}},{"Entity":{"atom":3}},{"Str":{"pattern":"réunion"}},{"Entity":{"atom":3}},{"Entity":{"atom":274}},{"Sequence":{"atoms":[297,298]}},{"Repetition":{"atom":299,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[291,292,293,294,295,296,300]}},{"Entity":{"atom":189}},{"Entity":{"atom":3}},{"Entity":{"atom":229}},{"Str":{"pattern":"e"}},{"Entity":{"atom":3}},{"Entity":{"atom":310}},{"Str":{"pattern":"Réunion"}},{"Str":{"pattern":"réunion"}},{"Alternative":{"atoms":[308,309]}},{"Entity":{"atom":3}},{"Entity":{"atom":274}},{"Sequence":{"atoms":[311,312]}},{"Repetition":{"atom":313,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[302,303,304,305,306,307,314]}},{"Entity":{"atom":189}},{"Entity":{"atom":3}},{"Entity":{"atom":310}},{"Entity":{"atom":3}},{"Entity":{"atom":229}},{"Entity":{"atom":3}},{"Entity":{"atom":274}},{"Sequence":{"atoms":[321,322]}},{"Repetition":{"atom":323,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[316,317,318,319,320,324]}},{"Alternative":{"atoms":[301,315,325]}},{"Named":{"name":"meeting_fr","atom":326}},{"Entity":{"atom":348}},{"Entity":{"atom":189}},{"Entity":{"atom":3}},{"Entity":{"atom":338}},{"Str":{"pattern":"DECL"}},{"Str":{"pattern":"DECN"}},{"Str":{"pattern":"ACT"}},{"Str":{"pattern":"REC"}},{"Str":{"pattern":"RES"}},{"Alternative":{"atoms":[332,333,334,335,336]}},{"Named":{"name":"type_word","atom":337}},{"Entity":{"atom":3}},{"Entity":{"atom":229}},{"Sequence":{"atoms":[339,340]}},{"Repetition":{"atom":341,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":3}},{"Entity":{"atom":274}},{"Sequence":{"atoms":[343,344]}},{"Repetition":{"atom":345,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[329,330,331,342,346]}},{"Named":{"name":"committee_short","atom":347}},{"Entity":{"atom":370}},{"Entity":{"atom":189}},{"Entity":{"atom":3}},{"Entity":{"atom":360}},{"Str":{"pattern":"Recommendation"}},{"Str":{"pattern":"Declaration"}},{"Str":{"pattern":"Resolution"}},{"Str":{"pattern":"Statement"}},{"Str":{"pattern":"Decision"}},{"Str":{"pattern":"Action"}},{"Alternative":{"atoms":[353,354,355,356,357,358]}},{"Named":{"name":"type_word","atom":359}},{"Entity":{"atom":3}},{"Entity":{"atom":229}},{"Sequence":{"atoms":[361,362]}},{"Repetition":{"atom":363,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":3}},{"Entity":{"atom":247}},{"Sequence":{"atoms":[365,366]}},{"Repetition":{"atom":367,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[350,351,352,364,368]}},{"Named":{"name":"committee_long_en","atom":369}},{"Entity":{"atom":384}},{"Entity":{"atom":189}},{"Entity":{"atom":3}},{"Entity":{"atom":218}},{"Entity":{"atom":3}},{"Entity":{"atom":229}},{"Sequence":{"atoms":[375,376]}},{"Repetition":{"atom":377,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":3}},{"Entity":{"atom":247}},{"Sequence":{"atoms":[379,380]}},{"Repetition":{"atom":381,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[372,373,374,378,382]}},{"Named":{"name":"committee_long_fr","atom":383}},{"Entity":{"atom":394}},{"Entity":{"atom":189}},{"Entity":{"atom":3}},{"Entity":{"atom":229}},{"Entity":{"atom":3}},{"Entity":{"atom":274}},{"Sequence":{"atoms":[389,390]}},{"Repetition":{"atom":391,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[386,387,388,392]}},{"Named":{"name":"committee_bare","atom":393}},{"Alternative":{"atoms":[253,290,328,349,371,385]}},{"Alternative":{"atoms":[0,31,80,97,111,169,209,252]}}],"root":396},"bindings":[{"capture":"committee_short","path":"committee_short","type":"raw","card":null,"preprocess":null},{"capture":"committee_long_en","path":"committee_long_en","type":"raw","card":null,"preprocess":null},{"capture":"committee_long_fr","path":"committee_long_fr","type":"raw","card":null,"preprocess":null},{"capture":"committee_bare","path":"committee_bare","type":"raw","card":null,"preprocess":null},{"capture":"meeting_en","path":"meeting_en","type":"raw","card":null,"preprocess":null},{"capture":"meeting_fr","path":"meeting_fr","type":"raw","card":null,"preprocess":null},{"capture":"metrologia","path":"metrologia","type":"raw","card":null,"preprocess":null},{"capture":"si_brochure","path":"si_brochure","type":"raw","card":null,"preprocess":null},{"capture":"si_brochure_variant","path":"si_brochure_variant","type":"raw","card":null,"preprocess":null},{"capture":"si_brochure_section","path":"si_brochure_section","type":"raw","card":null,"preprocess":null},{"capture":"mep","path":"mep","type":"raw","card":null,"preprocess":null},{"capture":"guide","path":"guide","type":"raw","card":null,"preprocess":null},{"capture":"group","path":"group","type":"string","card":null,"preprocess":null},{"capture":"type_word","path":"type_word","type":"string","card":null,"preprocess":null},{"capture":"number","path":"number","type":"string","card":null,"preprocess":null},{"capture":"year","path":"year","type":"string","card":null,"preprocess":null},{"capture":"language","path":"language","type":"string","card":null,"preprocess":null},{"capture":"volume","path":"volume","type":"string","card":null,"preprocess":null},{"capture":"issue","path":"issue","type":"string","card":null,"preprocess":null},{"capture":"article","path":"article","type":"string","card":null,"preprocess":null},{"capture":"edition","path":"edition","type":"string","card":null,"preprocess":null},{"capture":"version","path":"version","type":"string","card":null,"preprocess":null},{"capture":"years","path":"years","type":"string","card":null,"preprocess":null},{"capture":"variant","path":"variant","type":"string","card":null,"preprocess":null},{"capture":"part","path":"part","type":"string","card":null,"preprocess":null},{"capture":"appendix","path":"appendix","type":"string","card":null,"preprocess":null},{"capture":"annex","path":"annex","type":"string","card":null,"preprocess":null},{"capture":"mep_code","path":"mep_code","type":"string","card":null,"preprocess":null},{"capture":"report_code","path":"report_code","type":"string","card":null,"preprocess":null},{"capture":"guide_kind","path":"guide_kind","type":"string","card":null,"preprocess":null}]}},"preprocess":{},"tables":{"bipm_groups":{"file":"bipm_groups.yaml","rows":[{"name":"CCAUV"},{"name":"CCDS"},{"name":"CCRI"},{"name":"CCPR"},{"name":"CCEM"},{"name":"CCQM"},{"name":"CCTF"},{"name":"JCRB"},{"name":"CGPM"},{"name":"CIPM"},{"name":"CCM"},{"name":"CCU"},{"name":"CCL"},{"name":"CCT"}]},"bipm_type_names_fr":{"file":"bipm_type_names_fr.yaml","rows":[{"name":"Recommandation"},{"name":"Déclaration"},{"name":"Résolution"},{"name":"Statement"},{"name":"Décision"},{"name":"Action"}]},"bipm_type_codes":{"file":"bipm_type_codes.yaml","rows":[{"name":"DECL"},{"name":"DECN"},{"name":"ACT"},{"name":"RES"},{"name":"REC"}]},"bipm_type_names_en":{"file":"bipm_type_names_en.yaml","rows":[{"name":"Recommendation"},{"name":"Declaration"},{"name":"Resolution"},{"name":"Statement"},{"name":"Decision"},{"name":"Action"}]}},"lint":{"order_warnings":["rule connective: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)","rule group_leading: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)","rule group_leading: branches 1 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule group_leading: branches 1 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule group_leading: branches 1 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule group_leading: branches 1 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule group_leading: branches 2 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule group_leading: branches 2 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule group_leading: branches 2 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule group_leading: branches 2 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule group_leading: branches 3 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule group_leading: branches 3 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule group_leading: branches 3 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule group_leading: branches 4 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule group_leading: branches 4 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule group_leading: branches 5 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 2 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 2 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 2 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 2 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 2 and 7 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 3 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 3 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 3 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 3 and 7 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 4 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 4 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 4 and 7 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 5 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 5 and 7 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 6 and 8 are order-dependent (shared first bytes; ordered choice is decisive)"]},"default_entry":"identifier","render":{},"derive":{},"tests":[{"entry":"identifier","kind":"accept","input":"SI Brochure 9e v3.0 (2019, EN)","expect":{}},{"entry":"identifier","kind":"accept","input":"SI MEP 10","expect":{}},{"entry":"identifier","kind":"accept","input":"CGPM 26th Meeting (2018)","expect":{}},{"entry":"identifier","kind":"accept","input":"Metrologia 24 3","expect":{}},{"entry":"identifier","kind":"accept","input":"CGPM 12","expect":{}},{"entry":"identifier","kind":"accept","input":"CCTF REC 2","expect":{}},{"entry":"identifier","kind":"accept","input":"BIPM SI Brochure Appendix 2","expect":{}},{"entry":"identifier","kind":"accept","input":"SI Brochure Part 1","expect":{}},{"entry":"identifier","kind":"reject","input":"nonsense","expect":{}}],"docs":{},"source":"# Port of lib/pubid/bipm/parser.rb — BIPM identifiers: committee forms\n# (short/long EN/FR, meetings incl. French <sup>e</sup>), Metrologia,\n# the SI Brochure family, MEP/Guide reports. Groups and type names come\n# from gem-extracted tables (bipm_*.yaml), longest-first.\n#\n# Edition-2 conversion. The builder dispatches on the branch-wrapper\n# keys (committee_short, committee_long_en, committee_long_fr,\n# committee_bare, meeting_en, meeting_fr, metrologia, si_brochure,\n# si_brochure_variant, si_brochure_section, mep, guide), so every\n# wrapper is kept as a v1-shaped capture whose value is the inner-leaf\n# hash (or the bare scalar for the journal-level Metrologia record) and\n# binds uncast with the (raw) type; the leaves additionally bind flat.\n# Pure-raw rule bodies are inlined at capture sites (digits, alnum) so\n# every capture subtree carries only its own named leaves.\n\ngrammar PubidBipm version \"0.1.0\" edition 2 {\n digit = %x30-39\n dot = \".\"\n letter = %x41-5A / %x61-7A\n space = \" \"\n dash = \"-\"\n slash = \"/\"\n colon = \":\"\n lparen = \"(\"\n rparen = \")\"\n\n number = (1*digit *(dash 1*digit)) as number\n year = (4digit) as year\n lang = (\"EN\" / \"FR\" / %x45 / %x46) as language\n year_paren = \"(\" year [(\", \" lang)] \")\"\n year_paren_nolang = \"(\" year \")\"\n group = alt from_table \"bipm_groups\" column \"name\" as group\n type_abbrev = alt from_table \"bipm_type_codes\" column \"name\" as type_word\n type_name_en = alt from_table \"bipm_type_names_en\" column \"name\" as type_word\n type_name_fr = alt from_table \"bipm_type_names_fr\" column \"name\" as type_word\n connective = \"de la\" / \"du\"\n ordinal = \"st\" / \"nd\" / \"rd\" / \"th\"\n meeting_word_fr = \"Réunion\" / \"réunion\"\n\n committee_short = {\n (\n (\n group\n space\n type_abbrev\n [(space number)]\n [(space year_paren)]\n ) as committee_short\n )\n }\n committee_long_en = {\n (\n (\n group\n space\n type_name_en\n [(space number)]\n [(space year_paren_nolang)]\n ) as committee_long_en\n )\n }\n committee_long_fr = {\n (\n (\n type_name_fr\n [(space number)]\n space\n connective\n space\n group\n [(space year_paren_nolang)]\n ) as committee_long_fr\n )\n }\n committee_group_fr = {\n (\n (\n group\n space\n type_name_fr\n [(space number)]\n [(space year_paren_nolang)]\n ) as committee_long_fr\n )\n }\n committee_bare = ((group space number [(space year_paren)]) as committee_bare)\n\n meeting_en = {\n (\n (\n (group space number ordinal space \"Meeting\" [(space year_paren)])\n / (group space \"Meeting\" space number [(space year_paren)])\n ) as meeting_en\n )\n }\n meeting_fr = {\n (\n (\n (group space number \"<sup>e</sup>\" space \"réunion\" [(space year_paren)])\n / (group space number \"e\" space meeting_word_fr [(space year_paren)])\n / (group space meeting_word_fr space number [(space year_paren)])\n ) as meeting_fr\n )\n }\n\n metrologia = {\n (\n \"Metrologia\"\n [\n (\n space (1*digit) as volume\n [\n (\n space (1*(digit / letter)) as issue\n [\n (space (1*(digit / letter)) as article)\n ]\n )\n ]\n )\n ]\n ) as metrologia\n }\n\n edition = ((1*digit) \"e\") as edition\n version = (\"v\" 1*(digit / dot)) as version\n years = ((1*digit) [(slash (1*digit))]) as years\n si_brochure = {\n (\n (\"BIPM SI Brochure\" / \"SI Brochure\")\n space\n [\"sur le SI\" space]\n edition\n space\n version\n space\n \"(\" years \", \" lang \")\"\n ) as si_brochure\n }\n brochure_variant = ((\"Appendix\" space (1*digit)) / \"Concise\" / \"FAQ\") as variant\n si_brochure_variant = {\n (\n (\"BIPM SI Brochure\" / \"SI Brochure\")\n space\n brochure_variant\n ) as si_brochure_variant\n }\n si_brochure_section = {\n (\n (\"BIPM SI Brochure\" / \"SI Brochure\")\n [(space \"Part\" space (1*digit) as part)]\n ) as si_brochure_section\n }\n\n appendix_part = {\n \"Appendix\"\n space\n (1*digit) as appendix\n [(space \"Annex\" space (1*digit) as annex)]\n space\n \"Part\"\n space\n (((1*digit) [(dot (1*digit))]) as part)\n }\n mep_code = (1*(digit / letter)) as mep_code\n report_code = (\"BIPM-\" (1*digit) slash (1*digit)) as report_code\n mep_body = ((\"SI MEP\" space mep_code) / (\"Rapport\" space report_code))\n mep = ((\"BIPM\" space mep_body space appendix_part) / mep_body) as mep\n guide_kind = (\"MeP\" / \"RSI\") as guide_kind\n guide_body = group \"-GD-\" guide_kind dash (1*digit) as number\n guide = ((\"BIPM\" space guide_body space appendix_part) / guide_body) as guide\n\n group_leading = {\n meeting_en\n / meeting_fr\n / committee_short\n / committee_long_en\n / committee_group_fr\n / committee_bare\n }\n identifier = {\n metrologia\n / si_brochure\n / si_brochure_variant\n / si_brochure_section\n / mep\n / guide\n / committee_long_fr\n / group_leading\n }\n\n entry identifier: identifier\n\n bindings identifier {\n committee_short -> committee_short (raw)\n committee_long_en -> committee_long_en (raw)\n committee_long_fr -> committee_long_fr (raw)\n committee_bare -> committee_bare (raw)\n meeting_en -> meeting_en (raw)\n meeting_fr -> meeting_fr (raw)\n metrologia -> metrologia (raw)\n si_brochure -> si_brochure (raw)\n si_brochure_variant -> si_brochure_variant (raw)\n si_brochure_section -> si_brochure_section (raw)\n mep -> mep (raw)\n guide -> guide (raw)\n group -> group (string)\n type_word -> type_word (string)\n number -> number (string)\n year -> year (string)\n language -> language (string)\n volume -> volume (string)\n issue -> issue (string)\n article -> article (string)\n edition -> edition (string)\n version -> version (string)\n years -> years (string)\n variant -> variant (string)\n part -> part (string)\n appendix -> appendix (string)\n annex -> annex (string)\n mep_code -> mep_code (string)\n report_code -> report_code (string)\n guide_kind -> guide_kind (string)\n }\n\n test {\n accept \"SI Brochure 9e v3.0 (2019, EN)\"\n accept \"SI MEP 10\"\n accept \"CGPM 26th Meeting (2018)\"\n accept \"Metrologia 24 3\"\n accept \"CGPM 12\"\n accept \"CCTF REC 2\"\n accept \"BIPM SI Brochure Appendix 2\"\n accept \"SI Brochure Part 1\"\n reject \"nonsense\"\n }\n}\n","source_hash":"1c8cca3eb636d11774ae374e3157cbbd93d56f7d6e5ff9fbb5092a7cf3b6155f","unicode_tables":"onigmo (Ruby 3.4.8)","compiler_version":"1.3.114","edition":2,"checksum":"sha256:7ffed4923575262d39e6101e2fbfafb2f8586ebd7747c82dfbf3a43f4f1ba891"}
|
|
1
|
+
{"bindings":null,"version":"0.1.0","grammar":"PubidBipm","shape":"parsanol-tree/v2","binding_version":1,"entries":{"identifier":{"root":"identifier","grammar":{"atoms":[{"Entity":{"atom":30}},{"Str":{"pattern":"Metrologia"}},{"Entity":{"atom":3}},{"Str":{"pattern":" "}},{"Entity":{"atom":5}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":4,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"volume","atom":6}},{"Entity":{"atom":3}},{"Entity":{"atom":5}},{"Entity":{"atom":13}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Alternative":{"atoms":[11,12]}},{"Alternative":{"atoms":[9,10]}},{"Repetition":{"atom":14,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"issue","atom":15}},{"Entity":{"atom":3}},{"Entity":{"atom":5}},{"Entity":{"atom":13}},{"Alternative":{"atoms":[18,19]}},{"Repetition":{"atom":20,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"article","atom":21}},{"Sequence":{"atoms":[17,22]}},{"Repetition":{"atom":23,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[8,16,24]}},{"Repetition":{"atom":25,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[2,7,26]}},{"Repetition":{"atom":27,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[1,28]}},{"Named":{"name":"metrologia","atom":29}},{"Entity":{"atom":84}},{"Str":{"pattern":"BIPM SI Brochure"}},{"Str":{"pattern":"SI Brochure"}},{"Str":{"pattern":"Brochure sur le SI"}},{"Alternative":{"atoms":[32,33,34]}},{"Entity":{"atom":3}},{"Str":{"pattern":"sur le SI"}},{"Entity":{"atom":3}},{"Sequence":{"atoms":[37,38]}},{"Repetition":{"atom":39,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":46}},{"Entity":{"atom":5}},{"Repetition":{"atom":42,"min":1,"max":null,"tag":"Repetition"}},{"Str":{"pattern":"e"}},{"Sequence":{"atoms":[43,44]}},{"Named":{"name":"edition","atom":45}},{"Entity":{"atom":3}},{"Entity":{"atom":56}},{"Str":{"pattern":"v"}},{"Entity":{"atom":5}},{"Entity":{"atom":52}},{"Str":{"pattern":"."}},{"Alternative":{"atoms":[50,51]}},{"Repetition":{"atom":53,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[49,54]}},{"Named":{"name":"version","atom":55}},{"Sequence":{"atoms":[47,48]}},{"Repetition":{"atom":57,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":3}},{"Str":{"pattern":"("}},{"Entity":{"atom":71}},{"Entity":{"atom":5}},{"Repetition":{"atom":62,"min":1,"max":null,"tag":"Repetition"}},{"Entity":{"atom":65}},{"Str":{"pattern":"/"}},{"Entity":{"atom":5}},{"Repetition":{"atom":66,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[64,67]}},{"Repetition":{"atom":68,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[63,69]}},{"Named":{"name":"years","atom":70}},{"Str":{"pattern":", "}},{"Entity":{"atom":79}},{"Str":{"pattern":"EN"}},{"Str":{"pattern":"FR"}},{"Re":{"pattern":"[E]"}},{"Re":{"pattern":"[F]"}},{"Alternative":{"atoms":[74,75,76,77]}},{"Named":{"name":"language","atom":78}},{"Sequence":{"atoms":[72,73]}},{"Repetition":{"atom":80,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":")"}},{"Sequence":{"atoms":[35,36,40,41,58,59,60,61,81,82]}},{"Named":{"name":"si_brochure","atom":83}},{"Entity":{"atom":101}},{"Str":{"pattern":"BIPM SI Brochure"}},{"Str":{"pattern":"SI Brochure"}},{"Alternative":{"atoms":[86,87]}},{"Entity":{"atom":3}},{"Entity":{"atom":99}},{"Str":{"pattern":"Appendix"}},{"Entity":{"atom":3}},{"Entity":{"atom":5}},{"Repetition":{"atom":93,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[91,92,94]}},{"Str":{"pattern":"Concise"}},{"Str":{"pattern":"FAQ"}},{"Alternative":{"atoms":[95,96,97]}},{"Named":{"name":"variant","atom":98}},{"Sequence":{"atoms":[88,89,90]}},{"Named":{"name":"si_brochure_variant","atom":100}},{"Entity":{"atom":115}},{"Str":{"pattern":"BIPM SI Brochure"}},{"Str":{"pattern":"SI Brochure"}},{"Alternative":{"atoms":[103,104]}},{"Entity":{"atom":3}},{"Str":{"pattern":"Part"}},{"Entity":{"atom":3}},{"Entity":{"atom":5}},{"Repetition":{"atom":109,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"part","atom":110}},{"Sequence":{"atoms":[106,107,108,111]}},{"Repetition":{"atom":112,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[105,113]}},{"Named":{"name":"si_brochure_section","atom":114}},{"Entity":{"atom":147}},{"Str":{"pattern":"SI Brochure"}},{"Entity":{"atom":3}},{"Entity":{"atom":5}},{"Repetition":{"atom":119,"min":1,"max":null,"tag":"Repetition"}},{"Entity":{"atom":126}},{"Str":{"pattern":"st"}},{"Str":{"pattern":"nd"}},{"Str":{"pattern":"rd"}},{"Str":{"pattern":"th"}},{"Alternative":{"atoms":[122,123,124,125]}},{"Sequence":{"atoms":[120,121]}},{"Named":{"name":"ordinal_edition","atom":127}},{"Entity":{"atom":3}},{"Str":{"pattern":"edition"}},{"Entity":{"atom":3}},{"Entity":{"atom":143}},{"Str":{"pattern":"("}},{"Entity":{"atom":137}},{"Entity":{"atom":5}},{"Repetition":{"atom":135,"min":4,"max":4,"tag":"Repetition"}},{"Named":{"name":"year","atom":136}},{"Str":{"pattern":", "}},{"Entity":{"atom":79}},{"Sequence":{"atoms":[138,139]}},{"Repetition":{"atom":140,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":")"}},{"Sequence":{"atoms":[133,134,141,142]}},{"Sequence":{"atoms":[131,132]}},{"Repetition":{"atom":144,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[117,118,128,129,130,145]}},{"Named":{"name":"si_brochure_ordinal_edition","atom":146}},{"Entity":{"atom":205}},{"Str":{"pattern":"BIPM"}},{"Entity":{"atom":3}},{"Entity":{"atom":173}},{"Str":{"pattern":"SI MEP"}},{"Entity":{"atom":3}},{"Entity":{"atom":159}},{"Entity":{"atom":5}},{"Entity":{"atom":13}},{"Alternative":{"atoms":[155,156]}},{"Repetition":{"atom":157,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"mep_code","atom":158}},{"Sequence":{"atoms":[152,153,154]}},{"Str":{"pattern":"Rapport"}},{"Entity":{"atom":3}},{"Entity":{"atom":171}},{"Str":{"pattern":"BIPM-"}},{"Entity":{"atom":5}},{"Repetition":{"atom":165,"min":1,"max":null,"tag":"Repetition"}},{"Entity":{"atom":65}},{"Entity":{"atom":5}},{"Repetition":{"atom":168,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[164,166,167,169]}},{"Named":{"name":"report_code","atom":170}},{"Sequence":{"atoms":[161,162,163]}},{"Alternative":{"atoms":[160,172]}},{"Entity":{"atom":3}},{"Entity":{"atom":201}},{"Str":{"pattern":"Appendix"}},{"Entity":{"atom":3}},{"Entity":{"atom":5}},{"Repetition":{"atom":178,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"appendix","atom":179}},{"Entity":{"atom":3}},{"Str":{"pattern":"Annex"}},{"Entity":{"atom":3}},{"Entity":{"atom":5}},{"Repetition":{"atom":184,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"annex","atom":185}},{"Sequence":{"atoms":[181,182,183,186]}},{"Repetition":{"atom":187,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":3}},{"Str":{"pattern":"Part"}},{"Entity":{"atom":3}},{"Entity":{"atom":5}},{"Repetition":{"atom":192,"min":1,"max":null,"tag":"Repetition"}},{"Entity":{"atom":52}},{"Entity":{"atom":5}},{"Repetition":{"atom":195,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[194,196]}},{"Repetition":{"atom":197,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[193,198]}},{"Named":{"name":"part","atom":199}},{"Sequence":{"atoms":[176,177,180,188,189,190,191,200]}},{"Sequence":{"atoms":[149,150,151,174,175]}},{"Entity":{"atom":173}},{"Alternative":{"atoms":[202,203]}},{"Named":{"name":"mep","atom":204}},{"Entity":{"atom":244}},{"Str":{"pattern":"BIPM"}},{"Entity":{"atom":3}},{"Entity":{"atom":238}},{"Entity":{"atom":226}},{"Str":{"pattern":"CCAUV"}},{"Str":{"pattern":"CCDS"}},{"Str":{"pattern":"CCEM"}},{"Str":{"pattern":"CCPR"}},{"Str":{"pattern":"CCQM"}},{"Str":{"pattern":"CCRI"}},{"Str":{"pattern":"CCTF"}},{"Str":{"pattern":"CGPM"}},{"Str":{"pattern":"CIPM"}},{"Str":{"pattern":"JCRB"}},{"Str":{"pattern":"CCL"}},{"Str":{"pattern":"CCM"}},{"Str":{"pattern":"CCT"}},{"Str":{"pattern":"CCU"}},{"Alternative":{"atoms":[211,212,213,214,215,216,217,218,219,220,221,222,223,224]}},{"Named":{"name":"group","atom":225}},{"Str":{"pattern":"-GD-"}},{"Entity":{"atom":232}},{"Str":{"pattern":"MeP"}},{"Str":{"pattern":"RSI"}},{"Alternative":{"atoms":[229,230]}},{"Named":{"name":"guide_kind","atom":231}},{"Entity":{"atom":234}},{"Str":{"pattern":"-"}},{"Entity":{"atom":5}},{"Repetition":{"atom":235,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"number","atom":236}},{"Sequence":{"atoms":[210,227,228,233,237]}},{"Entity":{"atom":3}},{"Entity":{"atom":201}},{"Sequence":{"atoms":[207,208,209,239,240]}},{"Entity":{"atom":238}},{"Alternative":{"atoms":[241,242]}},{"Named":{"name":"guide","atom":243}},{"Entity":{"atom":295}},{"Entity":{"atom":254}},{"Str":{"pattern":"Recommandation"}},{"Str":{"pattern":"Déclaration"}},{"Str":{"pattern":"Résolution"}},{"Str":{"pattern":"Statement"}},{"Str":{"pattern":"Décision"}},{"Str":{"pattern":"Action"}},{"Alternative":{"atoms":[247,248,249,250,251,252]}},{"Named":{"name":"type_word","atom":253}},{"Entity":{"atom":3}},{"Entity":{"atom":265}},{"Entity":{"atom":5}},{"Repetition":{"atom":257,"min":1,"max":null,"tag":"Repetition"}},{"Entity":{"atom":234}},{"Entity":{"atom":5}},{"Repetition":{"atom":260,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[259,261]}},{"Repetition":{"atom":262,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[258,263]}},{"Named":{"name":"number","atom":264}},{"Sequence":{"atoms":[255,256]}},{"Repetition":{"atom":266,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":3}},{"Entity":{"atom":272}},{"Str":{"pattern":"de la"}},{"Str":{"pattern":"du"}},{"Alternative":{"atoms":[270,271]}},{"Entity":{"atom":3}},{"Entity":{"atom":226}},{"Entity":{"atom":3}},{"Entity":{"atom":280}},{"Str":{"pattern":"("}},{"Entity":{"atom":137}},{"Str":{"pattern":")"}},{"Sequence":{"atoms":[277,278,279]}},{"Sequence":{"atoms":[275,276]}},{"Repetition":{"atom":281,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[246,267,268,269,273,274,282]}},{"Entity":{"atom":254}},{"Entity":{"atom":3}},{"Entity":{"atom":226}},{"Entity":{"atom":65}},{"Entity":{"atom":265}},{"Entity":{"atom":3}},{"Entity":{"atom":280}},{"Sequence":{"atoms":[289,290]}},{"Repetition":{"atom":291,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[284,285,286,287,288,292]}},{"Alternative":{"atoms":[283,293]}},{"Named":{"name":"committee_long_fr","atom":294}},{"Entity":{"atom":316}},{"Str":{"pattern":"BIPM"}},{"Entity":{"atom":3}},{"Entity":{"atom":306}},{"Str":{"pattern":"DECL"}},{"Str":{"pattern":"DECN"}},{"Str":{"pattern":"ACT"}},{"Str":{"pattern":"REC"}},{"Str":{"pattern":"RES"}},{"Alternative":{"atoms":[300,301,302,303,304]}},{"Named":{"name":"type_word","atom":305}},{"Entity":{"atom":3}},{"Entity":{"atom":226}},{"Entity":{"atom":65}},{"Entity":{"atom":265}},{"Entity":{"atom":3}},{"Entity":{"atom":143}},{"Sequence":{"atoms":[311,312]}},{"Repetition":{"atom":313,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[297,298,299,307,308,309,310,314]}},{"Named":{"name":"committee_prefixed","atom":315}},{"Entity":{"atom":478}},{"Entity":{"atom":366}},{"Entity":{"atom":226}},{"Entity":{"atom":3}},{"Entity":{"atom":265}},{"Entity":{"atom":126}},{"Entity":{"atom":3}},{"Str":{"pattern":"Meeting"}},{"Entity":{"atom":3}},{"Entity":{"atom":143}},{"Sequence":{"atoms":[325,326]}},{"Repetition":{"atom":327,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[319,320,321,322,323,324,328]}},{"Entity":{"atom":226}},{"Entity":{"atom":3}},{"Str":{"pattern":"Meeting"}},{"Entity":{"atom":3}},{"Entity":{"atom":265}},{"Entity":{"atom":3}},{"Entity":{"atom":143}},{"Sequence":{"atoms":[335,336]}},{"Repetition":{"atom":337,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[330,331,332,333,334,338]}},{"Entity":{"atom":226}},{"Entity":{"atom":3}},{"Str":{"pattern":"--"}},{"Entity":{"atom":3}},{"Entity":{"atom":265}},{"Entity":{"atom":126}},{"Entity":{"atom":3}},{"Str":{"pattern":"Meeting"}},{"Entity":{"atom":3}},{"Entity":{"atom":143}},{"Sequence":{"atoms":[348,349]}},{"Repetition":{"atom":350,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[340,341,342,343,344,345,346,347,351]}},{"Entity":{"atom":226}},{"Entity":{"atom":3}},{"Str":{"pattern":"--"}},{"Entity":{"atom":3}},{"Str":{"pattern":"Meeting"}},{"Entity":{"atom":3}},{"Entity":{"atom":265}},{"Entity":{"atom":3}},{"Entity":{"atom":143}},{"Sequence":{"atoms":[360,361]}},{"Repetition":{"atom":362,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[353,354,355,356,357,358,359,363]}},{"Alternative":{"atoms":[329,339,352,364]}},{"Named":{"name":"meeting_en","atom":365}},{"Entity":{"atom":404}},{"Entity":{"atom":226}},{"Entity":{"atom":3}},{"Entity":{"atom":265}},{"Str":{"pattern":"<sup>e</sup>"}},{"Entity":{"atom":3}},{"Str":{"pattern":"réunion"}},{"Entity":{"atom":3}},{"Entity":{"atom":143}},{"Sequence":{"atoms":[374,375]}},{"Repetition":{"atom":376,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[368,369,370,371,372,373,377]}},{"Entity":{"atom":226}},{"Entity":{"atom":3}},{"Entity":{"atom":265}},{"Str":{"pattern":"e"}},{"Entity":{"atom":3}},{"Entity":{"atom":387}},{"Str":{"pattern":"Réunion"}},{"Str":{"pattern":"réunion"}},{"Alternative":{"atoms":[385,386]}},{"Entity":{"atom":3}},{"Entity":{"atom":143}},{"Sequence":{"atoms":[388,389]}},{"Repetition":{"atom":390,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[379,380,381,382,383,384,391]}},{"Entity":{"atom":226}},{"Entity":{"atom":3}},{"Entity":{"atom":387}},{"Entity":{"atom":3}},{"Entity":{"atom":265}},{"Entity":{"atom":3}},{"Entity":{"atom":143}},{"Sequence":{"atoms":[398,399]}},{"Repetition":{"atom":400,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[393,394,395,396,397,401]}},{"Alternative":{"atoms":[378,392,402]}},{"Named":{"name":"meeting_fr","atom":403}},{"Entity":{"atom":431}},{"Entity":{"atom":226}},{"Entity":{"atom":3}},{"Entity":{"atom":306}},{"Entity":{"atom":3}},{"Entity":{"atom":265}},{"Entity":{"atom":3}},{"Str":{"pattern":"A"}},{"Entity":{"atom":5}},{"Repetition":{"atom":413,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"appendix","atom":414}},{"Entity":{"atom":52}},{"Entity":{"atom":5}},{"Repetition":{"atom":417,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"annex","atom":418}},{"Sequence":{"atoms":[416,419]}},{"Repetition":{"atom":420,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[411,412,415,421]}},{"Repetition":{"atom":422,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[409,410,423]}},{"Repetition":{"atom":424,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":3}},{"Entity":{"atom":143}},{"Sequence":{"atoms":[426,427]}},{"Repetition":{"atom":428,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[406,407,408,425,429]}},{"Named":{"name":"committee_short","atom":430}},{"Entity":{"atom":453}},{"Entity":{"atom":226}},{"Entity":{"atom":3}},{"Entity":{"atom":443}},{"Str":{"pattern":"Recommendation"}},{"Str":{"pattern":"Declaration"}},{"Str":{"pattern":"Resolution"}},{"Str":{"pattern":"Statement"}},{"Str":{"pattern":"Decision"}},{"Str":{"pattern":"Action"}},{"Alternative":{"atoms":[436,437,438,439,440,441]}},{"Named":{"name":"type_word","atom":442}},{"Entity":{"atom":3}},{"Entity":{"atom":265}},{"Sequence":{"atoms":[444,445]}},{"Repetition":{"atom":446,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":3}},{"Entity":{"atom":280}},{"Sequence":{"atoms":[448,449]}},{"Repetition":{"atom":450,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[433,434,435,447,451]}},{"Named":{"name":"committee_long_en","atom":452}},{"Entity":{"atom":467}},{"Entity":{"atom":226}},{"Entity":{"atom":3}},{"Entity":{"atom":254}},{"Entity":{"atom":3}},{"Entity":{"atom":265}},{"Sequence":{"atoms":[458,459]}},{"Repetition":{"atom":460,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":3}},{"Entity":{"atom":280}},{"Sequence":{"atoms":[462,463]}},{"Repetition":{"atom":464,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[455,456,457,461,465]}},{"Named":{"name":"committee_long_fr","atom":466}},{"Entity":{"atom":477}},{"Entity":{"atom":226}},{"Entity":{"atom":3}},{"Entity":{"atom":265}},{"Entity":{"atom":3}},{"Entity":{"atom":143}},{"Sequence":{"atoms":[472,473]}},{"Repetition":{"atom":474,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[469,470,471,475]}},{"Named":{"name":"committee_bare","atom":476}},{"Alternative":{"atoms":[318,367,405,432,454,468]}},{"Alternative":{"atoms":[0,31,85,102,116,148,206,245,296,317]}}],"root":479},"bindings":[{"capture":"committee_short","path":"committee_short","type":"raw","card":null,"preprocess":null},{"capture":"committee_prefixed","path":"committee_prefixed","type":"raw","card":null,"preprocess":null},{"capture":"committee_long_en","path":"committee_long_en","type":"raw","card":null,"preprocess":null},{"capture":"committee_long_fr","path":"committee_long_fr","type":"raw","card":null,"preprocess":null},{"capture":"committee_bare","path":"committee_bare","type":"raw","card":null,"preprocess":null},{"capture":"meeting_en","path":"meeting_en","type":"raw","card":null,"preprocess":null},{"capture":"meeting_fr","path":"meeting_fr","type":"raw","card":null,"preprocess":null},{"capture":"metrologia","path":"metrologia","type":"raw","card":null,"preprocess":null},{"capture":"si_brochure","path":"si_brochure","type":"raw","card":null,"preprocess":null},{"capture":"si_brochure_ordinal_edition","path":"si_brochure_ordinal_edition","type":"raw","card":null,"preprocess":null},{"capture":"si_brochure_variant","path":"si_brochure_variant","type":"raw","card":null,"preprocess":null},{"capture":"si_brochure_section","path":"si_brochure_section","type":"raw","card":null,"preprocess":null},{"capture":"mep","path":"mep","type":"raw","card":null,"preprocess":null},{"capture":"guide","path":"guide","type":"raw","card":null,"preprocess":null},{"capture":"group","path":"group","type":"string","card":null,"preprocess":null},{"capture":"type_word","path":"type_word","type":"string","card":null,"preprocess":null},{"capture":"number","path":"number","type":"string","card":null,"preprocess":null},{"capture":"year","path":"year","type":"string","card":null,"preprocess":null},{"capture":"language","path":"language","type":"string","card":null,"preprocess":null},{"capture":"volume","path":"volume","type":"string","card":null,"preprocess":null},{"capture":"issue","path":"issue","type":"string","card":null,"preprocess":null},{"capture":"article","path":"article","type":"string","card":null,"preprocess":null},{"capture":"edition","path":"edition","type":"string","card":null,"preprocess":null},{"capture":"version","path":"version","type":"string","card":null,"preprocess":null},{"capture":"years","path":"years","type":"string","card":null,"preprocess":null},{"capture":"variant","path":"variant","type":"string","card":null,"preprocess":null},{"capture":"part","path":"part","type":"string","card":null,"preprocess":null},{"capture":"appendix","path":"appendix","type":"string","card":null,"preprocess":null},{"capture":"annex","path":"annex","type":"string","card":null,"preprocess":null},{"capture":"mep_code","path":"mep_code","type":"string","card":null,"preprocess":null},{"capture":"report_code","path":"report_code","type":"string","card":null,"preprocess":null},{"capture":"guide_kind","path":"guide_kind","type":"string","card":null,"preprocess":null},{"capture":"ordinal_edition","path":"ordinal_edition","type":"string","card":null,"preprocess":null}]}},"preprocess":{},"tables":{"bipm_groups":{"file":"bipm_groups.yaml","rows":[{"name":"CCAUV"},{"name":"CCDS"},{"name":"CCRI"},{"name":"CCPR"},{"name":"CCEM"},{"name":"CCQM"},{"name":"CCTF"},{"name":"JCRB"},{"name":"CGPM"},{"name":"CIPM"},{"name":"CCM"},{"name":"CCU"},{"name":"CCL"},{"name":"CCT"}]},"bipm_type_names_fr":{"file":"bipm_type_names_fr.yaml","rows":[{"name":"Recommandation"},{"name":"Déclaration"},{"name":"Résolution"},{"name":"Statement"},{"name":"Décision"},{"name":"Action"}]},"bipm_type_codes":{"file":"bipm_type_codes.yaml","rows":[{"name":"DECL"},{"name":"DECN"},{"name":"ACT"},{"name":"RES"},{"name":"REC"}]},"bipm_type_names_en":{"file":"bipm_type_names_en.yaml","rows":[{"name":"Recommendation"},{"name":"Declaration"},{"name":"Resolution"},{"name":"Statement"},{"name":"Decision"},{"name":"Action"}]}},"lint":{"order_warnings":["rule connective: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)","rule group_leading: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)","rule group_leading: branches 1 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule group_leading: branches 1 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule group_leading: branches 1 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule group_leading: branches 1 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule group_leading: branches 2 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule group_leading: branches 2 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule group_leading: branches 2 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule group_leading: branches 2 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule group_leading: branches 3 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule group_leading: branches 3 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule group_leading: branches 3 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule group_leading: branches 4 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule group_leading: branches 4 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule group_leading: branches 5 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 2 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 2 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 2 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 2 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 2 and 7 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 2 and 8 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 2 and 9 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 3 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 3 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 3 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 3 and 7 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 3 and 8 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 3 and 9 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 4 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 4 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 4 and 7 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 4 and 8 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 4 and 9 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 5 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 5 and 8 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 6 and 7 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 6 and 8 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 6 and 9 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 7 and 9 are order-dependent (shared first bytes; ordered choice is decisive)","rule identifier: branches 7 and 10 are order-dependent (shared first bytes; ordered choice is decisive)"]},"default_entry":"identifier","render":{},"derive":{},"tests":[{"entry":"identifier","kind":"accept","input":"SI Brochure 9e v3.0 (2019, EN)","expect":{}},{"entry":"identifier","kind":"accept","input":"SI MEP 10","expect":{}},{"entry":"identifier","kind":"accept","input":"CGPM 26th Meeting (2018)","expect":{}},{"entry":"identifier","kind":"accept","input":"Metrologia 24 3","expect":{}},{"entry":"identifier","kind":"accept","input":"CGPM 12","expect":{}},{"entry":"identifier","kind":"accept","input":"CCTF REC 2","expect":{}},{"entry":"identifier","kind":"accept","input":"BIPM SI Brochure Appendix 2","expect":{}},{"entry":"identifier","kind":"accept","input":"SI Brochure Part 1","expect":{}},{"entry":"identifier","kind":"accept","input":"CGPM -- Meeting 1 (1889)","expect":{}},{"entry":"identifier","kind":"accept","input":"BIPM DECN CIPM/101-1 (2012, EN)","expect":{}},{"entry":"identifier","kind":"accept","input":"BIPM DECN CIPM/101-1 (2012, FR)","expect":{}},{"entry":"identifier","kind":"accept","input":"Décision CIPM/111-10 (2022)","expect":{}},{"entry":"identifier","kind":"accept","input":"Recommandation JCRB/43-1 (2021)","expect":{}},{"entry":"identifier","kind":"accept","input":"CIPM DECN 111-10-2 (2022, F)","expect":{}},{"entry":"identifier","kind":"accept","input":"CIPM DECN 112 A3 (2022, F)","expect":{}},{"entry":"identifier","kind":"accept","input":"CIPM DECN 112 A3.5 (2022, F)","expect":{}},{"entry":"identifier","kind":"accept","input":"SI Brochure 9e v3.01 (2019/2024)","expect":{}},{"entry":"identifier","kind":"accept","input":"SI Brochure 9e (2019, E)","expect":{}},{"entry":"identifier","kind":"accept","input":"Brochure sur le SI 9e v3.01 (2019/2024, F)","expect":{}},{"entry":"identifier","kind":"accept","input":"SI Brochure 9th edition (2019)","expect":{}},{"entry":"identifier","kind":"reject","input":"nonsense","expect":{}}],"docs":{},"source":"# Port of lib/pubid/bipm/parser.rb — BIPM identifiers: committee forms\n# (short/long EN/FR, meetings incl. French <sup>e</sup>), Metrologia,\n# the SI Brochure family, MEP/Guide reports. Groups and type names come\n# from gem-extracted tables (bipm_*.yaml), longest-first.\n#\n# Edition-2 conversion. The builder dispatches on the branch-wrapper\n# keys (committee_short, committee_long_en, committee_long_fr,\n# committee_bare, meeting_en, meeting_fr, metrologia, si_brochure,\n# si_brochure_variant, si_brochure_section, mep, guide), so every\n# wrapper is kept as a v1-shaped capture whose value is the inner-leaf\n# hash (or the bare scalar for the journal-level Metrologia record) and\n# binds uncast with the (raw) type; the leaves additionally bind flat.\n# Pure-raw rule bodies are inlined at capture sites (digits, alnum) so\n# every capture subtree carries only its own named leaves.\n\ngrammar PubidBipm version \"0.1.0\" edition 2 {\n digit = %x30-39\n dot = \".\"\n letter = %x41-5A / %x61-7A\n space = \" \"\n dash = \"-\"\n slash = \"/\"\n colon = \":\"\n lparen = \"(\"\n rparen = \")\"\n\n number = (1*digit *(dash 1*digit)) as number\n year = (4digit) as year\n lang = (\"EN\" / \"FR\" / %x45 / %x46) as language\n year_paren = \"(\" year [(\", \" lang)] \")\"\n year_paren_nolang = \"(\" year \")\"\n group = alt from_table \"bipm_groups\" column \"name\" as group\n type_abbrev = alt from_table \"bipm_type_codes\" column \"name\" as type_word\n type_name_en = alt from_table \"bipm_type_names_en\" column \"name\" as type_word\n type_name_fr = alt from_table \"bipm_type_names_fr\" column \"name\" as type_word\n connective = \"de la\" / \"du\"\n ordinal = \"st\" / \"nd\" / \"rd\" / \"th\"\n meeting_word_fr = \"Réunion\" / \"réunion\"\n\n committee_short = {\n (\n (\n group\n space\n type_abbrev\n [(space number [(space \"A\" (1*digit) as appendix [dot (1*digit) as annex])])]\n [(space year_paren)]\n ) as committee_short\n )\n }\n # The publisher-prefixed decision form the corpus cites\n # (\"BIPM DECN CIPM/101-1 (2012, EN)\"): a literal BIPM publisher lead, the\n # outcome type, then the body-qualified resource-specific-id \"{body}/{id}\".\n # It names the same document as the unprefixed \"<body> <TYPE> <id>\" form, so\n # the builder dispatches it through the same CommitteeDocument path.\n committee_prefixed = {\n (\n (\n \"BIPM\"\n space\n type_abbrev\n space\n group\n slash\n number\n [(space year_paren)]\n ) as committee_prefixed\n )\n }\n committee_long_en = {\n (\n (\n group\n space\n type_name_en\n [(space number)]\n [(space year_paren_nolang)]\n ) as committee_long_en\n )\n }\n committee_long_fr = {\n (\n (\n (type_name_fr [(space number)] space connective space group [(space year_paren_nolang)])\n / (type_name_fr space group slash number [(space year_paren_nolang)])\n ) as committee_long_fr\n )\n }\n committee_group_fr = {\n (\n (\n group\n space\n type_name_fr\n [(space number)]\n [(space year_paren_nolang)]\n ) as committee_long_fr\n )\n }\n committee_bare = ((group space number [(space year_paren)]) as committee_bare)\n\n meeting_en = {\n (\n (\n (group space number ordinal space \"Meeting\" [(space year_paren)])\n / (group space \"Meeting\" space number [(space year_paren)])\n / (group space \"--\" space number ordinal space \"Meeting\" [(space year_paren)])\n / (group space \"--\" space \"Meeting\" space number [(space year_paren)])\n ) as meeting_en\n )\n }\n meeting_fr = {\n (\n (\n (group space number \"<sup>e</sup>\" space \"réunion\" [(space year_paren)])\n / (group space number \"e\" space meeting_word_fr [(space year_paren)])\n / (group space meeting_word_fr space number [(space year_paren)])\n ) as meeting_fr\n )\n }\n\n metrologia = {\n (\n \"Metrologia\"\n [\n (\n space (1*digit) as volume\n [\n (\n space (1*(digit / letter)) as issue\n [\n (space (1*(digit / letter)) as article)\n ]\n )\n ]\n )\n ]\n ) as metrologia\n }\n\n edition = ((1*digit) \"e\") as edition\n version = (\"v\" 1*(digit / dot)) as version\n years = ((1*digit) [(slash (1*digit))]) as years\n si_brochure = {\n (\n (\n (\"BIPM SI Brochure\" / \"SI Brochure\" / \"Brochure sur le SI\")\n space\n [\"sur le SI\" space]\n edition\n [space version]\n space\n \"(\" years [(\", \" lang)] \")\"\n ) as si_brochure\n )\n }\n # The guide's language-independent form drops the language code and the\n # version is optional (\"SI Brochure 9e (2019, E)\"); the guide's French\n # publication identifier leads with \"Brochure sur le SI\" instead of the\n # English brochure name. All render in the canonical \"BIPM SI Brochure …\"\n # spelling. The corpus-cited ordinal-edition spelling normalizes the\n # English \"9th edition\" onto the canonical \"9e\" edition value.\n si_brochure_ordinal_edition = {\n (\n (\n \"SI Brochure\"\n space\n ((1*digit) ordinal) as ordinal_edition\n space\n \"edition\"\n [(space year_paren)]\n ) as si_brochure_ordinal_edition\n )\n }\n brochure_variant = ((\"Appendix\" space (1*digit)) / \"Concise\" / \"FAQ\") as variant\n si_brochure_variant = {\n (\n (\"BIPM SI Brochure\" / \"SI Brochure\")\n space\n brochure_variant\n ) as si_brochure_variant\n }\n si_brochure_section = {\n (\n (\"BIPM SI Brochure\" / \"SI Brochure\")\n [(space \"Part\" space (1*digit) as part)]\n ) as si_brochure_section\n }\n\n appendix_part = {\n \"Appendix\"\n space\n (1*digit) as appendix\n [(space \"Annex\" space (1*digit) as annex)]\n space\n \"Part\"\n space\n (((1*digit) [(dot (1*digit))]) as part)\n }\n mep_code = (1*(digit / letter)) as mep_code\n report_code = (\"BIPM-\" (1*digit) slash (1*digit)) as report_code\n mep_body = ((\"SI MEP\" space mep_code) / (\"Rapport\" space report_code))\n mep = ((\"BIPM\" space mep_body space appendix_part) / mep_body) as mep\n guide_kind = (\"MeP\" / \"RSI\") as guide_kind\n guide_body = group \"-GD-\" guide_kind dash (1*digit) as number\n guide = ((\"BIPM\" space guide_body space appendix_part) / guide_body) as guide\n\n group_leading = {\n meeting_en\n / meeting_fr\n / committee_short\n / committee_long_en\n / committee_group_fr\n / committee_bare\n }\n identifier = {\n metrologia\n / si_brochure\n / si_brochure_variant\n / si_brochure_section\n / si_brochure_ordinal_edition\n / mep\n / guide\n / committee_long_fr\n / committee_prefixed\n / group_leading\n }\n\n entry identifier: identifier\n\n bindings identifier {\n committee_short -> committee_short (raw)\n committee_prefixed -> committee_prefixed (raw)\n committee_long_en -> committee_long_en (raw)\n committee_long_fr -> committee_long_fr (raw)\n committee_bare -> committee_bare (raw)\n meeting_en -> meeting_en (raw)\n meeting_fr -> meeting_fr (raw)\n metrologia -> metrologia (raw)\n si_brochure -> si_brochure (raw)\n si_brochure_ordinal_edition -> si_brochure_ordinal_edition (raw)\n si_brochure_variant -> si_brochure_variant (raw)\n si_brochure_section -> si_brochure_section (raw)\n mep -> mep (raw)\n guide -> guide (raw)\n group -> group (string)\n type_word -> type_word (string)\n number -> number (string)\n year -> year (string)\n language -> language (string)\n volume -> volume (string)\n issue -> issue (string)\n article -> article (string)\n edition -> edition (string)\n version -> version (string)\n years -> years (string)\n variant -> variant (string)\n part -> part (string)\n appendix -> appendix (string)\n annex -> annex (string)\n mep_code -> mep_code (string)\n report_code -> report_code (string)\n guide_kind -> guide_kind (string)\n ordinal_edition -> ordinal_edition (string)\n }\n\n test {\n accept \"SI Brochure 9e v3.0 (2019, EN)\"\n accept \"SI MEP 10\"\n accept \"CGPM 26th Meeting (2018)\"\n accept \"Metrologia 24 3\"\n accept \"CGPM 12\"\n accept \"CCTF REC 2\"\n accept \"BIPM SI Brochure Appendix 2\"\n accept \"SI Brochure Part 1\"\n accept \"CGPM -- Meeting 1 (1889)\"\n accept \"BIPM DECN CIPM/101-1 (2012, EN)\"\n accept \"BIPM DECN CIPM/101-1 (2012, FR)\"\n accept \"Décision CIPM/111-10 (2022)\"\n accept \"Recommandation JCRB/43-1 (2021)\"\n accept \"CIPM DECN 111-10-2 (2022, F)\"\n accept \"CIPM DECN 112 A3 (2022, F)\"\n accept \"CIPM DECN 112 A3.5 (2022, F)\"\n accept \"SI Brochure 9e v3.01 (2019/2024)\"\n accept \"SI Brochure 9e (2019, E)\"\n accept \"Brochure sur le SI 9e v3.01 (2019/2024, F)\"\n accept \"SI Brochure 9th edition (2019)\"\n reject \"nonsense\"\n }\n}\n","source_hash":"dfac00d992c8c6c0837554c97a9e6d476ee56105afddaa7c941f3386864d3af9","unicode_tables":"onigmo (Ruby 3.4.8)","compiler_version":"1.3.126","edition":2,"semantics_hash":"sha256:c2aac10d52235493f171181d334fa85b81a40813ba17abe101a038ae5aef643f","checksum":"sha256:7b8da36d5f3e19f6554fb64ec2763e799f8cf03bde3274e5aec3d83462d65375"}
|
data/data/parg/bipm.parg
ADDED
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
# Port of lib/pubid/bipm/parser.rb — BIPM identifiers: committee forms
|
|
2
|
+
# (short/long EN/FR, meetings incl. French <sup>e</sup>), Metrologia,
|
|
3
|
+
# the SI Brochure family, MEP/Guide reports. Groups and type names come
|
|
4
|
+
# from gem-extracted tables (bipm_*.yaml), longest-first.
|
|
5
|
+
#
|
|
6
|
+
# Edition-2 conversion. The builder dispatches on the branch-wrapper
|
|
7
|
+
# keys (committee_short, committee_long_en, committee_long_fr,
|
|
8
|
+
# committee_bare, meeting_en, meeting_fr, metrologia, si_brochure,
|
|
9
|
+
# si_brochure_variant, si_brochure_section, mep, guide), so every
|
|
10
|
+
# wrapper is kept as a v1-shaped capture whose value is the inner-leaf
|
|
11
|
+
# hash (or the bare scalar for the journal-level Metrologia record) and
|
|
12
|
+
# binds uncast with the (raw) type; the leaves additionally bind flat.
|
|
13
|
+
# Pure-raw rule bodies are inlined at capture sites (digits, alnum) so
|
|
14
|
+
# every capture subtree carries only its own named leaves.
|
|
15
|
+
|
|
16
|
+
grammar PubidBipm version "0.1.0" edition 2 {
|
|
17
|
+
digit = %x30-39
|
|
18
|
+
dot = "."
|
|
19
|
+
letter = %x41-5A / %x61-7A
|
|
20
|
+
space = " "
|
|
21
|
+
dash = "-"
|
|
22
|
+
slash = "/"
|
|
23
|
+
colon = ":"
|
|
24
|
+
lparen = "("
|
|
25
|
+
rparen = ")"
|
|
26
|
+
|
|
27
|
+
number = (1*digit *(dash 1*digit)) as number
|
|
28
|
+
year = (4digit) as year
|
|
29
|
+
lang = ("EN" / "FR" / %x45 / %x46) as language
|
|
30
|
+
year_paren = "(" year [(", " lang)] ")"
|
|
31
|
+
year_paren_nolang = "(" year ")"
|
|
32
|
+
group = alt from_table "bipm_groups" column "name" as group
|
|
33
|
+
type_abbrev = alt from_table "bipm_type_codes" column "name" as type_word
|
|
34
|
+
type_name_en = alt from_table "bipm_type_names_en" column "name" as type_word
|
|
35
|
+
type_name_fr = alt from_table "bipm_type_names_fr" column "name" as type_word
|
|
36
|
+
connective = "de la" / "du"
|
|
37
|
+
ordinal = "st" / "nd" / "rd" / "th"
|
|
38
|
+
meeting_word_fr = "Réunion" / "réunion"
|
|
39
|
+
|
|
40
|
+
committee_short = {
|
|
41
|
+
(
|
|
42
|
+
(
|
|
43
|
+
group
|
|
44
|
+
space
|
|
45
|
+
type_abbrev
|
|
46
|
+
[(space number [(space "A" (1*digit) as appendix [dot (1*digit) as annex])])]
|
|
47
|
+
[(space year_paren)]
|
|
48
|
+
) as committee_short
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
# The publisher-prefixed decision form the corpus cites
|
|
52
|
+
# ("BIPM DECN CIPM/101-1 (2012, EN)"): a literal BIPM publisher lead, the
|
|
53
|
+
# outcome type, then the body-qualified resource-specific-id "{body}/{id}".
|
|
54
|
+
# It names the same document as the unprefixed "<body> <TYPE> <id>" form, so
|
|
55
|
+
# the builder dispatches it through the same CommitteeDocument path.
|
|
56
|
+
committee_prefixed = {
|
|
57
|
+
(
|
|
58
|
+
(
|
|
59
|
+
"BIPM"
|
|
60
|
+
space
|
|
61
|
+
type_abbrev
|
|
62
|
+
space
|
|
63
|
+
group
|
|
64
|
+
slash
|
|
65
|
+
number
|
|
66
|
+
[(space year_paren)]
|
|
67
|
+
) as committee_prefixed
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
committee_long_en = {
|
|
71
|
+
(
|
|
72
|
+
(
|
|
73
|
+
group
|
|
74
|
+
space
|
|
75
|
+
type_name_en
|
|
76
|
+
[(space number)]
|
|
77
|
+
[(space year_paren_nolang)]
|
|
78
|
+
) as committee_long_en
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
committee_long_fr = {
|
|
82
|
+
(
|
|
83
|
+
(
|
|
84
|
+
(type_name_fr [(space number)] space connective space group [(space year_paren_nolang)])
|
|
85
|
+
/ (type_name_fr space group slash number [(space year_paren_nolang)])
|
|
86
|
+
) as committee_long_fr
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
committee_group_fr = {
|
|
90
|
+
(
|
|
91
|
+
(
|
|
92
|
+
group
|
|
93
|
+
space
|
|
94
|
+
type_name_fr
|
|
95
|
+
[(space number)]
|
|
96
|
+
[(space year_paren_nolang)]
|
|
97
|
+
) as committee_long_fr
|
|
98
|
+
)
|
|
99
|
+
}
|
|
100
|
+
committee_bare = ((group space number [(space year_paren)]) as committee_bare)
|
|
101
|
+
|
|
102
|
+
meeting_en = {
|
|
103
|
+
(
|
|
104
|
+
(
|
|
105
|
+
(group space number ordinal space "Meeting" [(space year_paren)])
|
|
106
|
+
/ (group space "Meeting" space number [(space year_paren)])
|
|
107
|
+
/ (group space "--" space number ordinal space "Meeting" [(space year_paren)])
|
|
108
|
+
/ (group space "--" space "Meeting" space number [(space year_paren)])
|
|
109
|
+
) as meeting_en
|
|
110
|
+
)
|
|
111
|
+
}
|
|
112
|
+
meeting_fr = {
|
|
113
|
+
(
|
|
114
|
+
(
|
|
115
|
+
(group space number "<sup>e</sup>" space "réunion" [(space year_paren)])
|
|
116
|
+
/ (group space number "e" space meeting_word_fr [(space year_paren)])
|
|
117
|
+
/ (group space meeting_word_fr space number [(space year_paren)])
|
|
118
|
+
) as meeting_fr
|
|
119
|
+
)
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
metrologia = {
|
|
123
|
+
(
|
|
124
|
+
"Metrologia"
|
|
125
|
+
[
|
|
126
|
+
(
|
|
127
|
+
space (1*digit) as volume
|
|
128
|
+
[
|
|
129
|
+
(
|
|
130
|
+
space (1*(digit / letter)) as issue
|
|
131
|
+
[
|
|
132
|
+
(space (1*(digit / letter)) as article)
|
|
133
|
+
]
|
|
134
|
+
)
|
|
135
|
+
]
|
|
136
|
+
)
|
|
137
|
+
]
|
|
138
|
+
) as metrologia
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
edition = ((1*digit) "e") as edition
|
|
142
|
+
version = ("v" 1*(digit / dot)) as version
|
|
143
|
+
years = ((1*digit) [(slash (1*digit))]) as years
|
|
144
|
+
si_brochure = {
|
|
145
|
+
(
|
|
146
|
+
(
|
|
147
|
+
("BIPM SI Brochure" / "SI Brochure" / "Brochure sur le SI")
|
|
148
|
+
space
|
|
149
|
+
["sur le SI" space]
|
|
150
|
+
edition
|
|
151
|
+
[space version]
|
|
152
|
+
space
|
|
153
|
+
"(" years [(", " lang)] ")"
|
|
154
|
+
) as si_brochure
|
|
155
|
+
)
|
|
156
|
+
}
|
|
157
|
+
# The guide's language-independent form drops the language code and the
|
|
158
|
+
# version is optional ("SI Brochure 9e (2019, E)"); the guide's French
|
|
159
|
+
# publication identifier leads with "Brochure sur le SI" instead of the
|
|
160
|
+
# English brochure name. All render in the canonical "BIPM SI Brochure …"
|
|
161
|
+
# spelling. The corpus-cited ordinal-edition spelling normalizes the
|
|
162
|
+
# English "9th edition" onto the canonical "9e" edition value.
|
|
163
|
+
si_brochure_ordinal_edition = {
|
|
164
|
+
(
|
|
165
|
+
(
|
|
166
|
+
"SI Brochure"
|
|
167
|
+
space
|
|
168
|
+
((1*digit) ordinal) as ordinal_edition
|
|
169
|
+
space
|
|
170
|
+
"edition"
|
|
171
|
+
[(space year_paren)]
|
|
172
|
+
) as si_brochure_ordinal_edition
|
|
173
|
+
)
|
|
174
|
+
}
|
|
175
|
+
brochure_variant = (("Appendix" space (1*digit)) / "Concise" / "FAQ") as variant
|
|
176
|
+
si_brochure_variant = {
|
|
177
|
+
(
|
|
178
|
+
("BIPM SI Brochure" / "SI Brochure")
|
|
179
|
+
space
|
|
180
|
+
brochure_variant
|
|
181
|
+
) as si_brochure_variant
|
|
182
|
+
}
|
|
183
|
+
si_brochure_section = {
|
|
184
|
+
(
|
|
185
|
+
("BIPM SI Brochure" / "SI Brochure")
|
|
186
|
+
[(space "Part" space (1*digit) as part)]
|
|
187
|
+
) as si_brochure_section
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
appendix_part = {
|
|
191
|
+
"Appendix"
|
|
192
|
+
space
|
|
193
|
+
(1*digit) as appendix
|
|
194
|
+
[(space "Annex" space (1*digit) as annex)]
|
|
195
|
+
space
|
|
196
|
+
"Part"
|
|
197
|
+
space
|
|
198
|
+
(((1*digit) [(dot (1*digit))]) as part)
|
|
199
|
+
}
|
|
200
|
+
mep_code = (1*(digit / letter)) as mep_code
|
|
201
|
+
report_code = ("BIPM-" (1*digit) slash (1*digit)) as report_code
|
|
202
|
+
mep_body = (("SI MEP" space mep_code) / ("Rapport" space report_code))
|
|
203
|
+
mep = (("BIPM" space mep_body space appendix_part) / mep_body) as mep
|
|
204
|
+
guide_kind = ("MeP" / "RSI") as guide_kind
|
|
205
|
+
guide_body = group "-GD-" guide_kind dash (1*digit) as number
|
|
206
|
+
guide = (("BIPM" space guide_body space appendix_part) / guide_body) as guide
|
|
207
|
+
|
|
208
|
+
group_leading = {
|
|
209
|
+
meeting_en
|
|
210
|
+
/ meeting_fr
|
|
211
|
+
/ committee_short
|
|
212
|
+
/ committee_long_en
|
|
213
|
+
/ committee_group_fr
|
|
214
|
+
/ committee_bare
|
|
215
|
+
}
|
|
216
|
+
identifier = {
|
|
217
|
+
metrologia
|
|
218
|
+
/ si_brochure
|
|
219
|
+
/ si_brochure_variant
|
|
220
|
+
/ si_brochure_section
|
|
221
|
+
/ si_brochure_ordinal_edition
|
|
222
|
+
/ mep
|
|
223
|
+
/ guide
|
|
224
|
+
/ committee_long_fr
|
|
225
|
+
/ committee_prefixed
|
|
226
|
+
/ group_leading
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
entry identifier: identifier
|
|
230
|
+
|
|
231
|
+
bindings identifier {
|
|
232
|
+
committee_short -> committee_short (raw)
|
|
233
|
+
committee_prefixed -> committee_prefixed (raw)
|
|
234
|
+
committee_long_en -> committee_long_en (raw)
|
|
235
|
+
committee_long_fr -> committee_long_fr (raw)
|
|
236
|
+
committee_bare -> committee_bare (raw)
|
|
237
|
+
meeting_en -> meeting_en (raw)
|
|
238
|
+
meeting_fr -> meeting_fr (raw)
|
|
239
|
+
metrologia -> metrologia (raw)
|
|
240
|
+
si_brochure -> si_brochure (raw)
|
|
241
|
+
si_brochure_ordinal_edition -> si_brochure_ordinal_edition (raw)
|
|
242
|
+
si_brochure_variant -> si_brochure_variant (raw)
|
|
243
|
+
si_brochure_section -> si_brochure_section (raw)
|
|
244
|
+
mep -> mep (raw)
|
|
245
|
+
guide -> guide (raw)
|
|
246
|
+
group -> group (string)
|
|
247
|
+
type_word -> type_word (string)
|
|
248
|
+
number -> number (string)
|
|
249
|
+
year -> year (string)
|
|
250
|
+
language -> language (string)
|
|
251
|
+
volume -> volume (string)
|
|
252
|
+
issue -> issue (string)
|
|
253
|
+
article -> article (string)
|
|
254
|
+
edition -> edition (string)
|
|
255
|
+
version -> version (string)
|
|
256
|
+
years -> years (string)
|
|
257
|
+
variant -> variant (string)
|
|
258
|
+
part -> part (string)
|
|
259
|
+
appendix -> appendix (string)
|
|
260
|
+
annex -> annex (string)
|
|
261
|
+
mep_code -> mep_code (string)
|
|
262
|
+
report_code -> report_code (string)
|
|
263
|
+
guide_kind -> guide_kind (string)
|
|
264
|
+
ordinal_edition -> ordinal_edition (string)
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
test {
|
|
268
|
+
accept "SI Brochure 9e v3.0 (2019, EN)"
|
|
269
|
+
accept "SI MEP 10"
|
|
270
|
+
accept "CGPM 26th Meeting (2018)"
|
|
271
|
+
accept "Metrologia 24 3"
|
|
272
|
+
accept "CGPM 12"
|
|
273
|
+
accept "CCTF REC 2"
|
|
274
|
+
accept "BIPM SI Brochure Appendix 2"
|
|
275
|
+
accept "SI Brochure Part 1"
|
|
276
|
+
accept "CGPM -- Meeting 1 (1889)"
|
|
277
|
+
accept "BIPM DECN CIPM/101-1 (2012, EN)"
|
|
278
|
+
accept "BIPM DECN CIPM/101-1 (2012, FR)"
|
|
279
|
+
accept "Décision CIPM/111-10 (2022)"
|
|
280
|
+
accept "Recommandation JCRB/43-1 (2021)"
|
|
281
|
+
accept "CIPM DECN 111-10-2 (2022, F)"
|
|
282
|
+
accept "CIPM DECN 112 A3 (2022, F)"
|
|
283
|
+
accept "CIPM DECN 112 A3.5 (2022, F)"
|
|
284
|
+
accept "SI Brochure 9e v3.01 (2019/2024)"
|
|
285
|
+
accept "SI Brochure 9e (2019, E)"
|
|
286
|
+
accept "Brochure sur le SI 9e v3.01 (2019/2024, F)"
|
|
287
|
+
accept "SI Brochure 9th edition (2019)"
|
|
288
|
+
reject "nonsense"
|
|
289
|
+
}
|
|
290
|
+
}
|
data/lib/pubid/bipm/CLAUDE.md
CHANGED
|
@@ -11,3 +11,5 @@ These notes were part of the root `CLAUDE.md`. Read them before you change `lib/
|
|
|
11
11
|
- **BIPM loose consumer forms (retiring `Relaton::Bipm::Id`)**: `Relaton::Bipm::Bibliography` could not use pubid as its **query** parser — it kept a bespoke regex grammar (`Relaton::Bipm::Id`) because `Pubid::Bipm.parse` rejected the spellings real references use. The grammar now accepts them, so relaton can match pubid-to-pubid like every other flavor. **All of these are NORMALIZING parses — the identifier renders back in BIPM's canonical spelling, never the input** — which is the whole point (a loose query must produce an identifier equal to the index row's), and which is exactly why they must **never** go into the byte-exact `spec/fixtures/bipm/identifiers/pass/` (the `CIPM/2005-06(REV)` precedent); their expectations live in `spec/pubid/bipm/loose_consumer_forms_spec.rb`. Six constructs: **(1) Meeting word order** — `meeting_en` gained a `<group> Meeting <n>` branch and `meeting_fr` gained a plain-`e` ordinal branch (`CIPM 111e Réunion (2022)`) and a `<group> Réunion <n>` branch, all normalizing to `CCTF 14th Meeting (1999)` / `CIPM 111<sup>e</sup> réunion (2022)`. **(2) `committee_group_fr`** — a French type name in the English (group-leading) word order (`CIPM Décision 101-1 (2012)` → `Décision 101-1 du CIPM (2012)`). Its slot in `group_leading` is **after `committee_long_en`**, which is load-bearing: `Action` and `Statement` are in *both* `TYPE_NAME_EN` and `TYPE_NAME_FR`, so the English rule must claim them first or `CIPM Action 5 (2010)` would flip to French. Like the existing French rules it sets `language: "F"` — information the user typed, which a consumer can always widen away but could never recover. **(3) `GROUP_ALIASES`** (`CCDS`→`CCTF`) and **(4) `LANGUAGE_ALIASES`** (`EN`→`E`, `FR`→`F`, longest-first in the `lang` rule so `EN` is never read as a bare `E`): both are resolved in the **builder**, so an alias never reaches an attribute and the index stores only the current name and the one-letter code. `PARSEABLE_GROUPS` (= `GROUPS + GROUP_ALIASES.keys`) is what the `group` rule alternates over; `GROUPS` itself is unchanged, so nothing else sees the alias. **(5) `si_brochure_section`** — the bare `SI Brochure` and `SI Brochure Part 1`. Neither names an edition, so **both are partial references with a nil `number`** that wildcard every edition (the date-less `CCTF REC 2` reading). `Part N` points at a section *inside* the brochure — there is no `si-brochure-part-1.yaml` upstream and relaton's `Id` deletes `:part` before comparing — so it rides in the shared `part` attribute and stays **out** of the index key, exactly as the MEP/guide `Part N.M` tail does. **A Parslet fact worth recording, because it contradicts what several comments in this repo imply**: Parslet threads `consume_all` down through an alternation, so an alternative matching only a **prefix** counts as a failure and the next one is tried — verified by reordering. `si_brochure_section` therefore cannot truncate `SI Brochure Concise` whatever its slot, and `committee_bare` could not shadow a typed form even if it came first. Alternation order decides **only** between two alternatives that both consume the *whole* input — which is exactly the `committee_long_en`-before-`committee_group_fr` case above, and the only ordering here that is genuinely load-bearing (verified: flipping it renders `CIPM Action 5 (2010)` as the French `Action 5 du CIPM (2010)`, a different record). The `BIPM ` prefix was also made **optional on the main `si_brochure` rule** (it already was on the variant rule): `si-brochure.yaml` stores its docnumber *without* it, and `Relaton::Bipm::Bibliography.search` strips a leading `BIPM ` before pubid ever sees the string — so `SI Brochure 9e v3.01 (2019/2024, E)` used to be a hard parse failure. **(6) `TYPE_WORD_ALIASES`** — a **data-corruption fix**: `Declaration`/`Déclaration` were in the `type_name_en`/`type_name_fr` alternations but **not** in `TYPE_WORD_TO_CODE` (which is built from `TYPE_NAME_EN`/`TYPE_NAME_FR`, where DECL's name is `Statement` in both languages), so `CGPM Declaration 1 (1971)` parsed with `type_code` **nil** and rendered as the corrupt `"CGPM 1 (1971)"` (double space), `Déclaration 1 du CGPM (1971)` as `" 1 de la CGPM (1971)"`. Both now map to DECL and render `Statement`. **The matching contract relaton needs** (pinned by the spec against real `index-v2` rows): committee-document and meeting rows are stored **language- and form-neutral** — verified, all 1348 + 367 — so the BIPM stem is **`pubid.exclude(:language, :form)`**, and every loose form reduces under it to the identifier rebuilt from its row. The SI Brochure is the exception: a nil-`edition` query must match *any* `SiBrochure` row, which is what `Id#id_hash`'s `{group: "SI", type: "Brochure"}` collapse already meant. **Also fixed here**: `UrnParser#build_metrologia`/`#build_si_brochure` never set the derived `number`, so a URN round-trip silently emptied the relaton index key (the shared `"flavor URN round-trip"` example only compares `to_urn`, so it was invisible) — now set from the same source the builder uses, guarded by a `presence` helper because an unfilled URN segment is `""`, not nil. **Verified**: all 7,922 published `relaton-data-bipm` rows re-parse from their own `to_s` with an identical hash, class and MR slug (0 mismatches, 0 MR collisions), and all 90 pass fixtures stay byte-exact. **Deliberately NOT changed:** `CCTF Recommendation 2009-02` still reads as the literal number `2009-02` while the index keys that document under `2` — genuinely ambiguous, since `NNNN-NN` is a real BIPM number form (`CIPM 2005-06`), so the consumer keeps a fallback. **Known pre-existing gap, deliberately untouched:** the SI Brochure URN carries only language/edition/version/years, so `Concise`, `FAQ` and `Appendix 3` — three distinct documents — already share `urn:bipm:si-brochure::::`, and the new bare/section forms join that bucket (defensibly, being partial references rather than distinct documents). Fixing it needs a URN-shape decision plus a matching `UrnParser` branch. `Pubid.parse` auto-routing does not resolve **any** BIPM form today (also pre-existing), so `PREFIXES` was left alone — adding `CCDS` there would change nothing observable. (hand-off: bipm-loose-consumer-forms; consumer follow-up: relaton__relaton__bipm-drop-id-parser-for-pubid.)
|
|
12
12
|
|
|
13
13
|
- **Routing reaches BIPM (`Pubid.parse`, pubid#644)**: the note above says "`Pubid.parse` auto-routing does not resolve **any** BIPM form today … so `PREFIXES` was left alone" — that is no longer true, in two halves. **(1) `PREFIXES` gained the two SI-family series tokens** `SI Brochure` and `SI MEP`: both lead real printed references on their own (`SI Brochure 9e v3.01 (2019/2024, E)` — the spelling relaton's `Bibliography#search` strips the `BIPM ` off, per the note above — and `SI MEP 10`), and before this both parsed **directly** but the router could not route them (no prefix owner ⇒ no non-exact fallback). "Rapport" stays excluded per the ambiguous-token policy (generic French word). **(2) The quoted-title form** `BIPM "The International System of Units"` — the brochure IS titled that — is mapped onto the parseable `BIPM SI Brochure` section form by **`data/bipm/update_codes.yaml`** (the CIPM-MRA precedent), so it parses as a **partial reference** that wildcards every edition, exactly like `SI Brochure Part 1`; the bare `"The International System of Units"` maps to `SI Brochure`. Both are normalizing parses and live with the loose-forms expectations, never in the byte-exact fixtures. The **French title is deliberately not mapped**: it names the F-language record specifically, and mapping it would silently drop typed language information (the loose-forms rule above). Also note the router's prefix-owner mechanism is what makes the normalizing parses routable: `Pubid::Bipm.parse("BIPM SI Brochure")` happens to round-trip exactly, but `SI Brochure 9e …` renders with the leading `BIPM ` the input lacked — without prefix-owner status the router would reject it. (hand-off: router-printed-forms-644.)
|
|
14
|
+
|
|
15
|
+
- **Corpus-cited forms + guide printings (pubid#657)**: the metanorma-bipm fetch queue cites two spellings the grammar rejected, and the 2026-11 guide update adds printings of its own. All are **parse-in forms over the existing canonical identities** — the canonical render follows the guide, nothing that already parsed changed. **(1) The em-dash meeting variant** `CGPM -- Meeting 1 (1889)`: `meeting_en` gained `<group> -- Meeting <n>` and `<group> -- <n><ord> Meeting` branches (the corpus cites only the first; the second is the same reordering over the other word order). They build through the existing `Meeting` path, so the canonical render is `CGPM 1st Meeting (1889)`. **(2) The publisher-prefixed decision** `BIPM DECN CIPM/101-1 (2012, EN)` (and `, FR`): new `committee_prefixed` rule — a **literal `BIPM`** lead (the constant publisher, deliberately NOT the `group` table, which contains BIPM and would collide with the second `group` capture), `type_abbrev`, then the body-qualified id `{group}/{number}`. Builds through `build_committee` short-form, so it equals `CIPM DECN 101-1 (2012, E)` — verified against real `index-v2` rows in `loose_consumer_forms_spec` (the corpus's citeas comes out as the BIPM-long style, which is the consumer's rendering choice, not pubid's). **(3) The guide's French body-prefixed long form** `Décision CIPM/111-10 (2022)` / `Recommandation JCRB/43-1 (2021)`: an alternative inside `committee_long_fr` (same capture name, so the same builder path — long form, language F). **The canonical French long form stays the connective spelling** (`Décision 101-1 du CIPM (2012)`) even though the guide's language-independent example prefers the body-prefixed one — the corpus freezes the connective render for what already parsed, and flipping the canonical would move frozen cases; that flip is an owner decision if the guide is adopted wholesale. **(4) SI Brochure guide forms**: the language code and the version are now OPTIONAL (`SI Brochure 9e v3.01 (2019/2024)` language-independent, `SI Brochure 9e (2019, E)` version-less — both byte round-trips with the canonical `BIPM SI Brochure ` lead), and the guide's French lead `Brochure sur le SI 9e …` parses as an alias of the `BIPM SI Brochure sur le SI …` canonical (note the lead alternation is `"BIPM SI Brochure" / "SI Brochure" / "Brochure sur le SI"` with the `["sur le SI" space]` phrase still optional after the first two — it just fails cleanly after the third). **(5) The corpus-cited ordinal-edition spelling** `SI Brochure 9th edition (2019)`: its own `si_brochure_ordinal_edition` rule (a separate branch, because the `edition` capture would otherwise bind `"9th"`); the builder strips the ordinal and appends `e`, so it normalizes onto `BIPM SI Brochure 9e (2019)`. **(6) Part numbers** (the guide's resource-specific-id numbering, `partnumbers` proposal, bipm-si-brochure#301): parts/subparts are dash forms inside `number` (`CIPM DECN 111-10-2`) and always parsed; the appendix/annex complement `CIPM DECN 112 A3[.5]` is the new optional ` A<n>[.<m>]` tail on `committee_short`, stored in the shared `appendix`/`annex` attributes (the MEP/guide tail's home), printed back byte-exactly by `appendix_segment`, folded into the URN identifier segment as `-a<n>[.<m>]` (`urn:bipm:cipm:decn:112-a3.5:2022` — unambiguous, because a bare number never carries letters; `UrnParser#split_appendix` splits it back), and joined into the MR number segment (`mr_slug` collapses the annex dot). It requires a number before it (`CIPM DECN A3` still fails). **URN deviations from the guide, deliberate**: the guide's own committee-example URNs (`urn:bipm:v1:cipm:resolution:95-2006:1`) carry a `v1` version segment and venue-qualified shapes the flavor's URNs never adopted (`urn:bipm:cipm:res:101-1:2012`, no `v1`, no venue segments — green for years, kept byte-identical); the new forms emit URNs under the EXISTING shape for the same reason, and the same applies to the brochure (`urn:bipm:si-brochure:<lang>:<edition>:<version>:<years>` vs the guide's `urn:bipm:v1:bipm:si-brochure:9:3.01:2024` — the guide strips the `e`/`v` and drops the language segment; adopting that is an index-affecting owner decision, not taken here). **One Ruby trap the URN fold exposed**: `id.number.to_s` on a String **attribute** returns the attribute itself, so building the folded segment by `<<` mutated `number` in place — every later `to_s`/`to_hash` of the same object then carried `-a3`; the fold is now interpolation, and `urn_spec` pins that a URN emission leaves `number` untouched. **The unmerged `si-brochure-id` proposal** (`SI Brochure 9`, `SI Brochure 9 (E)`, `SI Brochure 9 (2024) (F)` — bare-number edition) is NOT implemented: it conflicts with the merged guide's `9e` spelling. (hand-off: bipm-657-corpus-forms.)
|
data/lib/pubid/bipm/builder.rb
CHANGED
|
@@ -13,6 +13,11 @@ module Pubid
|
|
|
13
13
|
def build(data)
|
|
14
14
|
if data[:committee_short]
|
|
15
15
|
build_committee(data[:committee_short], form: "short")
|
|
16
|
+
elsif data[:committee_prefixed]
|
|
17
|
+
# The corpus's "BIPM DECN CIPM/101-1 (2012, EN)" publisher-prefixed
|
|
18
|
+
# spelling names the same document as the unprefixed short form; the
|
|
19
|
+
# BIPM lead is the constant publisher, so it carries no attribute.
|
|
20
|
+
build_committee(data[:committee_prefixed], form: "short")
|
|
16
21
|
elsif data[:committee_long_en]
|
|
17
22
|
build_committee(data[:committee_long_en], form: "long", language: "E")
|
|
18
23
|
elsif data[:committee_bare]
|
|
@@ -32,6 +37,8 @@ module Pubid
|
|
|
32
37
|
build_si_brochure_variant(data[:si_brochure_variant])
|
|
33
38
|
elsif data.key?(:si_brochure_section)
|
|
34
39
|
build_si_brochure_section(data[:si_brochure_section])
|
|
40
|
+
elsif data.key?(:si_brochure_ordinal_edition)
|
|
41
|
+
build_si_brochure_ordinal_edition(data[:si_brochure_ordinal_edition])
|
|
35
42
|
elsif data[:mep]
|
|
36
43
|
build_mep(data[:mep])
|
|
37
44
|
elsif data[:guide]
|
|
@@ -55,6 +62,8 @@ module Pubid
|
|
|
55
62
|
year: node[:year]&.to_s&.to_i,
|
|
56
63
|
language: Identifier.normalize_language(language || node[:language]),
|
|
57
64
|
form: form,
|
|
65
|
+
appendix: node[:appendix]&.to_s,
|
|
66
|
+
annex: node[:annex]&.to_s,
|
|
58
67
|
)
|
|
59
68
|
end
|
|
60
69
|
|
|
@@ -103,11 +112,13 @@ module Pubid
|
|
|
103
112
|
# The SI Brochure has no document number of its own, so the edition is
|
|
104
113
|
# the index key — it clusters the English and French records of one
|
|
105
114
|
# edition. The grammar makes `edition` mandatory here, so it is never nil.
|
|
115
|
+
# The version and the language code are optional (the guide's
|
|
116
|
+
# language-independent form), so they may be nil.
|
|
106
117
|
def build_si_brochure(node)
|
|
107
118
|
Identifiers::SiBrochure.new(
|
|
108
119
|
number: node[:edition].to_s,
|
|
109
120
|
edition: node[:edition].to_s,
|
|
110
|
-
version: node[:version]
|
|
121
|
+
version: node[:version]&.to_s,
|
|
111
122
|
years: node[:years].to_s,
|
|
112
123
|
language: Identifier.normalize_language(node[:language]),
|
|
113
124
|
)
|
|
@@ -128,6 +139,20 @@ module Pubid
|
|
|
128
139
|
Identifiers::SiBrochure.new(part: node[:part]&.to_s)
|
|
129
140
|
end
|
|
130
141
|
|
|
142
|
+
# The guide prints the edition "9e"; the corpus-cited "9th edition"
|
|
143
|
+
# spelling is the English ordinal form of the same edition, normalized
|
|
144
|
+
# onto the canonical "9e" value. The version is absent from the input, so
|
|
145
|
+
# it stays nil and drops from the serialized hash (a partial reference).
|
|
146
|
+
def build_si_brochure_ordinal_edition(node)
|
|
147
|
+
edition = "#{node[:ordinal_edition].to_s.sub(/(st|nd|rd|th)\z/, "")}e"
|
|
148
|
+
Identifiers::SiBrochure.new(
|
|
149
|
+
number: edition,
|
|
150
|
+
edition: edition,
|
|
151
|
+
years: node[:year]&.to_s,
|
|
152
|
+
language: Identifier.normalize_language(node[:language]),
|
|
153
|
+
)
|
|
154
|
+
end
|
|
155
|
+
|
|
131
156
|
# The Appendix/Annex/Part tail is the full-content spelling of the SAME
|
|
132
157
|
# document, so it stays out of the key.
|
|
133
158
|
def build_mep(node)
|
|
@@ -28,7 +28,19 @@ module Pubid
|
|
|
28
28
|
# The group has to be in the number segment or `CCTF REC 2` and
|
|
29
29
|
# `CCEM REC 2` would share a slug.
|
|
30
30
|
def mr_number_with_part
|
|
31
|
-
mr_slug(group, number)
|
|
31
|
+
mr_slug(group, number, appendix_tail)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
private
|
|
35
|
+
|
|
36
|
+
# The appendix/annex complement distinguishes the separately published
|
|
37
|
+
# subresources, so it joins the number segment (the language rule: what
|
|
38
|
+
# upstream stores as distinct files must slug distinctly). `mr_slug`
|
|
39
|
+
# collapses the annex dot, as it does the brochure's "v3.01".
|
|
40
|
+
def appendix_tail
|
|
41
|
+
return nil unless appendix
|
|
42
|
+
|
|
43
|
+
annex ? "a#{appendix}.#{annex}" : "a#{appendix}"
|
|
32
44
|
end
|
|
33
45
|
end
|
|
34
46
|
end
|
data/lib/pubid/bipm/renderer.rb
CHANGED
|
@@ -40,10 +40,20 @@ module Pubid
|
|
|
40
40
|
# leading space) rather than emit a double space.
|
|
41
41
|
lang = id.language ? ", #{id.language}" : ""
|
|
42
42
|
type = id.type_code ? " #{id.type_code}" : ""
|
|
43
|
-
"#{id.group}#{type}#{number_segment(id)}" \
|
|
43
|
+
"#{id.group}#{type}#{number_segment(id)}#{appendix_segment(id)}" \
|
|
44
44
|
"#{year_segment(id, lang: lang)}"
|
|
45
45
|
end
|
|
46
46
|
|
|
47
|
+
# The complement tail "{identifier} A{appendix}[.{annex}]" of the guide's
|
|
48
|
+
# resource-specific-id numbering (parts/subparts are dash forms inside
|
|
49
|
+
# `number` itself; appendices/annexes are this separate tail).
|
|
50
|
+
def appendix_segment(id)
|
|
51
|
+
return "" unless id.appendix
|
|
52
|
+
|
|
53
|
+
annex = id.annex ? ".#{id.annex}" : ""
|
|
54
|
+
" A#{id.appendix}#{annex}"
|
|
55
|
+
end
|
|
56
|
+
|
|
47
57
|
def render_committee_long(id)
|
|
48
58
|
if id.language == "F"
|
|
49
59
|
name = Identifier::TYPE_NAME_FR[id.type_code]
|
|
@@ -79,10 +89,15 @@ module Pubid
|
|
|
79
89
|
# to print either — just the brochure, optionally down to one part.
|
|
80
90
|
return "BIPM SI Brochure#{part_segment(id)}" unless id.edition
|
|
81
91
|
|
|
92
|
+
# The version is optional (the guide's "SI Brochure 9e (2019, E)" form)
|
|
93
|
+
# and the language code too (the language-independent form), so both
|
|
94
|
+
# segments are conditional.
|
|
82
95
|
phrase = id.language == "F" ? "sur le SI " : ""
|
|
83
96
|
lang = id.language ? ", #{id.language}" : ""
|
|
84
|
-
"BIPM SI Brochure #{phrase}#{id.edition}
|
|
85
|
-
|
|
97
|
+
result = +"BIPM SI Brochure #{phrase}#{id.edition}"
|
|
98
|
+
result << " #{id.version}" if id.version
|
|
99
|
+
result << " (#{id.years}#{lang})"
|
|
100
|
+
result
|
|
86
101
|
end
|
|
87
102
|
|
|
88
103
|
# Optional " Part <n>" segment of an SI Brochure section reference.
|
|
@@ -28,13 +28,26 @@ module Pubid
|
|
|
28
28
|
# type_code is nil for the bare MRA form → empty type segment, mirroring
|
|
29
29
|
# the empty-number-segment convention for number-less documents.
|
|
30
30
|
parts = ["urn", "bipm", id.group.downcase,
|
|
31
|
-
id.type_code.to_s.downcase, id
|
|
31
|
+
id.type_code.to_s.downcase, committee_number_segment(id)]
|
|
32
32
|
# A partial (date-less) reference drops the trailing year segment; a
|
|
33
33
|
# number-less-but-dated doc keeps its empty number segment.
|
|
34
34
|
parts << id.year if id.year
|
|
35
35
|
parts.join(":")
|
|
36
36
|
end
|
|
37
37
|
|
|
38
|
+
# The appendix/annex complement folds into the identifier segment as
|
|
39
|
+
# "-a{appendix}[.{annex}]". A bare number is digits and dashes only, so
|
|
40
|
+
# the letter-prefixed tail is unambiguous on the way back (UrnParser
|
|
41
|
+
# splits it). Built by interpolation, never by appending to
|
|
42
|
+
# `id.number.to_s` — on a String attribute that returns the attribute
|
|
43
|
+
# itself, so a `<<` would mutate the identifier's `number` in place.
|
|
44
|
+
def committee_number_segment(id)
|
|
45
|
+
return id.number.to_s unless id.appendix
|
|
46
|
+
|
|
47
|
+
tail = id.annex ? ".#{id.annex}" : ""
|
|
48
|
+
"#{id.number}-a#{id.appendix}#{tail}"
|
|
49
|
+
end
|
|
50
|
+
|
|
38
51
|
def meeting
|
|
39
52
|
id = identifier
|
|
40
53
|
parts = ["urn", "bipm", id.group.downcase, "meeting", id.number.to_s]
|
|
@@ -27,14 +27,27 @@ module Pubid
|
|
|
27
27
|
group: group, number: parts[2].to_s, year: parts[3]&.to_i,
|
|
28
28
|
)
|
|
29
29
|
else
|
|
30
|
+
number, appendix, annex = split_appendix(parts[2])
|
|
30
31
|
Identifiers::CommitteeDocument.new(
|
|
31
32
|
group: group,
|
|
32
33
|
type_code: (parts[1].empty? ? nil : parts[1].upcase),
|
|
33
|
-
number: (
|
|
34
|
+
number: (number.empty? ? nil : number), year: parts[3]&.to_i,
|
|
35
|
+
appendix: appendix, annex: annex,
|
|
34
36
|
)
|
|
35
37
|
end
|
|
36
38
|
end
|
|
37
39
|
|
|
40
|
+
# Inverse of UrnGenerator#committee_number_segment: splits the folded
|
|
41
|
+
# "-a{appendix}[.{annex}]" tail back out of the identifier segment. A
|
|
42
|
+
# bare number is digits and dashes only, so the letter-prefixed tail is
|
|
43
|
+
# unambiguous.
|
|
44
|
+
def split_appendix(segment)
|
|
45
|
+
match = segment.to_s.match(/\A(.+?)-a(\d+)(?:\.(\d+))?\z/)
|
|
46
|
+
return [segment, nil, nil] unless match
|
|
47
|
+
|
|
48
|
+
[match[1], match[2], match[3]]
|
|
49
|
+
end
|
|
50
|
+
|
|
38
51
|
# `number` is the relaton index key and is derived, not printed, so it has
|
|
39
52
|
# to be set here exactly as `Builder` sets it — a URN-reconstructed
|
|
40
53
|
# identifier must agree with a parsed one attribute for attribute.
|
data/lib/pubid/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pubid
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
@@ -71,6 +71,7 @@ files:
|
|
|
71
71
|
- data/parg/asme.json
|
|
72
72
|
- data/parg/astm.json
|
|
73
73
|
- data/parg/bipm.json
|
|
74
|
+
- data/parg/bipm.parg
|
|
74
75
|
- data/parg/bsi.json
|
|
75
76
|
- data/parg/calconnect.json
|
|
76
77
|
- data/parg/ccsds.json
|