pubid 2.0.2 → 2.0.3
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/ieee/update_codes.yaml +2 -2
- data/data/parg/aiee.json +1 -1
- data/data/parg/aiee.parg +99 -9
- data/data/parg/iala.json +1 -1
- data/data/parg/ieee.json +1 -1
- data/data/parg/ire.json +1 -1
- data/data/parg/ire.parg +51 -12
- data/data/parg/iso.json +1 -1
- data/data/parg/iso.parg +751 -0
- data/data/parg/jis.json +1 -1
- data/data/parg/nesc.json +1 -1
- data/data/parg/nesc.parg +97 -12
- data/data/parg/parg.json +1 -1
- data/lib/pubid/iala/builder.rb +48 -39
- data/lib/pubid/iala/identifier.rb +1 -1
- data/lib/pubid/ieee/CLAUDE.md +2 -0
- data/lib/pubid/ieee/aiee/identifier.rb +1 -1
- data/lib/pubid/ieee/builder.rb +175 -28
- data/lib/pubid/ieee/components/code.rb +46 -7
- data/lib/pubid/ieee/identifiers/base.rb +4 -1
- data/lib/pubid/ieee/identifiers/joint_development.rb +7 -3
- data/lib/pubid/ieee/ire/identifier.rb +1 -1
- data/lib/pubid/ieee/nesc/builder.rb +1 -1
- data/lib/pubid/ieee/project_renderer.rb +5 -1
- data/lib/pubid/ieee/renderer.rb +4 -2
- data/lib/pubid/ieee/urn_generator.rb +4 -1
- data/lib/pubid/iho/CLAUDE.md +15 -6
- data/lib/pubid/iho/urn_generator.rb +9 -6
- data/lib/pubid/iho/urn_parser.rb +43 -40
- data/lib/pubid/iso/CLAUDE.md +66 -0
- data/lib/pubid/iso/builder.rb +228 -14
- data/lib/pubid/iso/identifier.rb +22 -12
- data/lib/pubid/iso/normalizer.rb +5 -4
- data/lib/pubid/iso/urn_parser.rb +13 -8
- data/lib/pubid/jis/CLAUDE.md +36 -0
- data/lib/pubid/jis/builder.rb +12 -12
- data/lib/pubid/jis/identifier.rb +11 -1
- data/lib/pubid/jis/identifiers/welding_engineering_standard.rb +35 -0
- data/lib/pubid/jis/identifiers.rb +2 -0
- data/lib/pubid/jis/renderer.rb +1 -1
- data/lib/pubid/jis/supplement_identifier.rb +5 -5
- data/lib/pubid/jis/urn_parser.rb +2 -1
- data/lib/pubid/jis.rb +3 -2
- data/lib/pubid/version.rb +1 -1
- metadata +5 -2
data/data/parg/ire.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"bindings":null,"version":"0.1.0","grammar":"PubidIre","shape":"parsanol-tree/v2","binding_version":1,"entries":{"ire_identifier":{"root":"ire_identifier","grammar":{"atoms":[{"Entity":{"atom":
|
|
1
|
+
{"bindings":null,"version":"0.1.0","grammar":"PubidIre","shape":"parsanol-tree/v2","binding_version":1,"entries":{"ire_identifier":{"root":"ire_identifier","grammar":{"atoms":[{"Entity":{"atom":105}},{"Str":{"pattern":"191"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Sequence":{"atoms":[1,2]}},{"Str":{"pattern":"19"}},{"Str":{"pattern":"2"}},{"Str":{"pattern":"3"}},{"Str":{"pattern":"4"}},{"Str":{"pattern":"5"}},{"Alternative":{"atoms":[5,6,7,8]}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Sequence":{"atoms":[4,9,10]}},{"Str":{"pattern":"196"}},{"Re":{"pattern":"[\\x30-\\x33]"}},{"Sequence":{"atoms":[12,13]}},{"Re":{"pattern":"[\\x31-\\x36]"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Sequence":{"atoms":[15,16]}},{"Alternative":{"atoms":[3,11,14,17]}},{"Named":{"name":"year","atom":18}},{"Str":{"pattern":" "}},{"Entity":{"atom":25}},{"Str":{"pattern":"IEEE-IRE"}},{"Str":{"pattern":"IRE"}},{"Alternative":{"atoms":[22,23]}},{"Named":{"name":"publisher","atom":24}},{"Str":{"pattern":" "}},{"Entity":{"atom":32}},{"Str":{"pattern":"Trans."}},{"Str":{"pattern":"Standard"}},{"Str":{"pattern":"Std"}},{"Alternative":{"atoms":[28,29,30]}},{"Named":{"name":"type","atom":31}},{"Str":{"pattern":" "}},{"Sequence":{"atoms":[27,33]}},{"Repetition":{"atom":34,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":68}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":37,"min":1,"max":null,"tag":"Repetition"}},{"Str":{"pattern":" "}},{"Str":{"pattern":"."}},{"Alternative":{"atoms":[39,40]}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":43,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[38,41,42,44]}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":46,"min":1,"max":null,"tag":"Repetition"}},{"Str":{"pattern":"."}},{"Str":{"pattern":"IRE"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":50,"min":1,"max":null,"tag":"Repetition"}},{"Str":{"pattern":"."}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":53,"min":1,"max":null,"tag":"Repetition"}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":56,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[47,48,49,51,52,54,55,57]}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Repetition":{"atom":59,"min":2,"max":4,"tag":"Repetition"}},{"Str":{"pattern":"-"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":62,"min":1,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[60,61,63]}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Repetition":{"atom":65,"min":1,"max":null,"tag":"Repetition"}},{"Alternative":{"atoms":[45,58,64,66]}},{"Named":{"name":"number","atom":67}},{"Entity":{"atom":86}},{"Entity":{"atom":71}},{"Str":{"pattern":" "}},{"Entity":{"atom":73}},{"Str":{"pattern":"-"}},{"Named":{"name":"dash","atom":72}},{"Str":{"pattern":","}},{"Alternative":{"atoms":[74,75]}},{"Repetition":{"atom":76,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":71}},{"Repetition":{"atom":78,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[70,77,79]}},{"Entity":{"atom":73}},{"Named":{"name":"dash","atom":81}},{"Str":{"pattern":","}},{"Alternative":{"atoms":[82,83]}},{"Entity":{"atom":71}},{"Alternative":{"atoms":[80,84,85]}},{"Str":{"pattern":"191"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Sequence":{"atoms":[87,88]}},{"Str":{"pattern":"19"}},{"Str":{"pattern":"2"}},{"Str":{"pattern":"3"}},{"Str":{"pattern":"4"}},{"Str":{"pattern":"5"}},{"Alternative":{"atoms":[91,92,93,94]}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Sequence":{"atoms":[90,95,96]}},{"Str":{"pattern":"196"}},{"Re":{"pattern":"[\\x30-\\x33]"}},{"Sequence":{"atoms":[98,99]}},{"Alternative":{"atoms":[89,97,100]}},{"Named":{"name":"full_year","atom":101}},{"Sequence":{"atoms":[69,102]}},{"Repetition":{"atom":103,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[19,20,21,26,35,36,104]}},{"Entity":{"atom":136}},{"Entity":{"atom":25}},{"Str":{"pattern":" "}},{"Entity":{"atom":32}},{"Str":{"pattern":" "}},{"Sequence":{"atoms":[109,110]}},{"Repetition":{"atom":111,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":68}},{"Entity":{"atom":86}},{"Str":{"pattern":"191"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Sequence":{"atoms":[115,116]}},{"Str":{"pattern":"19"}},{"Str":{"pattern":"2"}},{"Str":{"pattern":"3"}},{"Str":{"pattern":"4"}},{"Str":{"pattern":"5"}},{"Alternative":{"atoms":[119,120,121,122]}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Sequence":{"atoms":[118,123,124]}},{"Str":{"pattern":"196"}},{"Re":{"pattern":"[\\x30-\\x33]"}},{"Sequence":{"atoms":[126,127]}},{"Re":{"pattern":"[\\x31-\\x36]"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Sequence":{"atoms":[129,130]}},{"Alternative":{"atoms":[117,125,128,131]}},{"Named":{"name":"year","atom":132}},{"Sequence":{"atoms":[114,133]}},{"Repetition":{"atom":134,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[107,108,112,113,135]}},{"Alternative":{"atoms":[0,106]}}],"root":137},"bindings":[{"capture":"publisher","path":"publisher","type":"string","card":null,"preprocess":null},{"capture":"type","path":"type","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":"full_year","path":"full_year","type":"string","card":null,"preprocess":null}]}},"preprocess":{},"tables":{},"lint":{"order_warnings":["rule year_full: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)","rule year_full: branches 1 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule year_full: branches 2 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule yr_sep: branches 1 and 3 are order-dependent (shared first bytes; ordered choice is decisive)"]},"default_entry":"ire_identifier","render":{},"derive":{},"tests":[{"entry":"ire_identifier","kind":"accept","input":"IRE Trans. PGI-7","expect":{}},{"entry":"ire_identifier","kind":"accept","input":"1930 IRE 20","expect":{}},{"entry":"ire_identifier","kind":"accept","input":"IRE Standard 15 S1","expect":{}},{"entry":"ire_identifier","kind":"accept","input":"IRE 28","expect":{}},{"entry":"ire_identifier","kind":"reject","input":"nonsense","expect":{}}],"docs":{},"source":"# Port of lib/pubid/ieee/ire/parser.rb — IRE (pre-IEEE) designations:\n# year-first and prefix-first forms, types (Trans./Standard/Std),\n# numbers (dotted letters, IRE-glued, letters-dash) and dates.\n# Consumed by the ieee grammar via `use ire`.\n#\n# Edition-2 notes: the year / year_full bodies are inlined at every\n# capture site (a capture wrapping a rule ref expands to element hashes,\n# while the inlined body binds as one scalar string), and the helper\n# spaces around captures stay raw literals (a parenthesized ref\n# materializes a stray named node).\n\ngrammar PubidIre version \"0.1.0\" edition 2 {\n digit = %x30-39\n upper = %x41-5A\n space = \" \"\n dash = \"-\"\n dot = \".\"\n\n year_short = (%x31-36 %x30-39)\n year_full = ((\"191\" %x30-39)) / ((\"19\" (\"2\" / \"3\" / \"4\" / \"5\") %x30-39)) / ((\"196\" %x30-33))\n ire_prefix = (\"IEEE-IRE\" / \"IRE\") as publisher\n ire_type = (\"Trans.\" / \"Standard\" / \"Std\") as type\n number = {\n (\n ( 1*(%x30-39) (\" \" / \".\") %x41-5A 1*(%x30-39) )\n / ( 1*(%x30-39) \".\" \"IRE\" 1*(%x30-39) \".\" 1*(%x30-39) %x41-5A 1*(%x30-39) )\n / ( 2*4%x41-5A \"-\" 1*(%x30-39) )\n / ( 1*(%x30-39) )\n ) as number\n }\n yr_sep = (space [(dash / \",\")] [space]) / (dash / \",\") / space\n\n # The trailing optional stays flattened on purpose: a nested\n # [([x] [y])] compiles to branches that commit past the leading space\n # in the pure-Ruby VM, losing the backtrack the year-less forms need.\n ire_identifier_year_first = {\n (\n (\"191\" %x30-39)\n / (\"19\" (\"2\" / \"3\" / \"4\" / \"5\") %x30-39)\n / (\"196\" %x30-33)\n / (%x31-36 %x30-39)\n ) as year\n \" \" ire_prefix \" \" [ire_type \" \"] number\n [ yr_sep (\n (\"191\" %x30-39)\n / (\"19\" (\"2\" / \"3\" / \"4\" / \"5\") %x30-39)\n / (\"196\" %x30-33)\n ) as full_year ]\n }\n ire_identifier_prefix_first = {\n ire_prefix \" \" [ire_type \" \"] number\n [ yr_sep (\n (\"191\" %x30-39)\n / (\"19\" (\"2\" / \"3\" / \"4\" / \"5\") %x30-39)\n / (\"196\" %x30-33)\n / (%x31-36 %x30-39)\n ) as year ]\n }\n ire_identifier = ire_identifier_year_first / ire_identifier_prefix_first\n\n entry ire_identifier: ire_identifier\n\n bindings ire_identifier {\n publisher -> publisher (string)\n type -> type (string)\n number -> number (string)\n year -> year (string)\n full_year -> full_year (string)\n }\n\n test {\n accept \"IRE Trans. PGI-7\"\n accept \"1930 IRE 20\"\n accept \"IRE Standard 15 S1\"\n accept \"IRE 28\"\n reject \"nonsense\"\n }\n}\n","source_hash":"c4e0006d9f6995e5c75e03b2f277fc9a078ca5d49367bbc17a48ac994b53ba8e","unicode_tables":"onigmo (Ruby 3.4.8)","compiler_version":"1.3.114","edition":2,"checksum":"sha256:d381eee0583376c50b1e0c48b3cef50380a2368fedf6932e592fff4469845e84"}
|
data/data/parg/ire.parg
CHANGED
|
@@ -2,33 +2,72 @@
|
|
|
2
2
|
# year-first and prefix-first forms, types (Trans./Standard/Std),
|
|
3
3
|
# numbers (dotted letters, IRE-glued, letters-dash) and dates.
|
|
4
4
|
# Consumed by the ieee grammar via `use ire`.
|
|
5
|
+
#
|
|
6
|
+
# Edition-2 notes: the year / year_full bodies are inlined at every
|
|
7
|
+
# capture site (a capture wrapping a rule ref expands to element hashes,
|
|
8
|
+
# while the inlined body binds as one scalar string), and the helper
|
|
9
|
+
# spaces around captures stay raw literals (a parenthesized ref
|
|
10
|
+
# materializes a stray named node).
|
|
5
11
|
|
|
6
|
-
grammar PubidIre version "0.1.0" {
|
|
12
|
+
grammar PubidIre version "0.1.0" edition 2 {
|
|
7
13
|
digit = %x30-39
|
|
8
14
|
upper = %x41-5A
|
|
9
|
-
digits = 1*digit
|
|
10
15
|
space = " "
|
|
11
16
|
dash = "-"
|
|
12
17
|
dot = "."
|
|
13
18
|
|
|
14
|
-
year_short = (%x31-36
|
|
15
|
-
year_full = (("191"
|
|
16
|
-
year = year_full / year_short
|
|
19
|
+
year_short = (%x31-36 %x30-39)
|
|
20
|
+
year_full = (("191" %x30-39)) / (("19" ("2" / "3" / "4" / "5") %x30-39)) / (("196" %x30-33))
|
|
17
21
|
ire_prefix = ("IEEE-IRE" / "IRE") as publisher
|
|
18
22
|
ire_type = ("Trans." / "Standard" / "Std") as type
|
|
19
|
-
number =
|
|
23
|
+
number = {
|
|
24
|
+
(
|
|
25
|
+
( 1*(%x30-39) (" " / ".") %x41-5A 1*(%x30-39) )
|
|
26
|
+
/ ( 1*(%x30-39) "." "IRE" 1*(%x30-39) "." 1*(%x30-39) %x41-5A 1*(%x30-39) )
|
|
27
|
+
/ ( 2*4%x41-5A "-" 1*(%x30-39) )
|
|
28
|
+
/ ( 1*(%x30-39) )
|
|
29
|
+
) as number
|
|
30
|
+
}
|
|
20
31
|
yr_sep = (space [(dash / ",")] [space]) / (dash / ",") / space
|
|
21
|
-
date = [yr_sep (year) as year]
|
|
22
32
|
|
|
23
|
-
# The trailing optional
|
|
24
|
-
# compiles to branches that commit past the leading space
|
|
25
|
-
# pure-Ruby VM, losing the backtrack the year-less forms need.
|
|
26
|
-
ire_identifier_year_first =
|
|
27
|
-
|
|
33
|
+
# The trailing optional stays flattened on purpose: a nested
|
|
34
|
+
# [([x] [y])] compiles to branches that commit past the leading space
|
|
35
|
+
# in the pure-Ruby VM, losing the backtrack the year-less forms need.
|
|
36
|
+
ire_identifier_year_first = {
|
|
37
|
+
(
|
|
38
|
+
("191" %x30-39)
|
|
39
|
+
/ ("19" ("2" / "3" / "4" / "5") %x30-39)
|
|
40
|
+
/ ("196" %x30-33)
|
|
41
|
+
/ (%x31-36 %x30-39)
|
|
42
|
+
) as year
|
|
43
|
+
" " ire_prefix " " [ire_type " "] number
|
|
44
|
+
[ yr_sep (
|
|
45
|
+
("191" %x30-39)
|
|
46
|
+
/ ("19" ("2" / "3" / "4" / "5") %x30-39)
|
|
47
|
+
/ ("196" %x30-33)
|
|
48
|
+
) as full_year ]
|
|
49
|
+
}
|
|
50
|
+
ire_identifier_prefix_first = {
|
|
51
|
+
ire_prefix " " [ire_type " "] number
|
|
52
|
+
[ yr_sep (
|
|
53
|
+
("191" %x30-39)
|
|
54
|
+
/ ("19" ("2" / "3" / "4" / "5") %x30-39)
|
|
55
|
+
/ ("196" %x30-33)
|
|
56
|
+
/ (%x31-36 %x30-39)
|
|
57
|
+
) as year ]
|
|
58
|
+
}
|
|
28
59
|
ire_identifier = ire_identifier_year_first / ire_identifier_prefix_first
|
|
29
60
|
|
|
30
61
|
entry ire_identifier: ire_identifier
|
|
31
62
|
|
|
63
|
+
bindings ire_identifier {
|
|
64
|
+
publisher -> publisher (string)
|
|
65
|
+
type -> type (string)
|
|
66
|
+
number -> number (string)
|
|
67
|
+
year -> year (string)
|
|
68
|
+
full_year -> full_year (string)
|
|
69
|
+
}
|
|
70
|
+
|
|
32
71
|
test {
|
|
33
72
|
accept "IRE Trans. PGI-7"
|
|
34
73
|
accept "1930 IRE 20"
|