pubid 2.0.0.pre.alpha.16 → 2.0.0.pre.alpha.17
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/ieee.json +1 -1
- data/lib/pubid/ieee/builder.rb +13 -0
- data/lib/pubid/ieee/components/draft.rb +6 -1
- data/lib/pubid/ieee/identifiers/joint_development.rb +33 -15
- data/lib/pubid/version.rb +1 -1
- metadata +1 -1
data/lib/pubid/ieee/builder.rb
CHANGED
|
@@ -868,6 +868,19 @@ module Pubid
|
|
|
868
868
|
attributes[:lead_party] = attributes[:publishers]&.first || "ISO"
|
|
869
869
|
attributes[:iso_stage] = extract_value(parsed[:iso_stage])
|
|
870
870
|
|
|
871
|
+
# A digit-suffixed stage word ("CD4", "DIS2") from a stage-FIRST
|
|
872
|
+
# spelling prints bare in the ISO face (every
|
|
873
|
+
# iso_stage_spellings_spec expectation: the iteration is draft
|
|
874
|
+
# machinery, not identity). The embedded/stage-last form keeps
|
|
875
|
+
# its "CD3" whole — its trailing token IS the identity the
|
|
876
|
+
# embedded corpus keys on (embedded_iso_stage_spec) — and
|
|
877
|
+
# serialized rows keep theirs verbatim (#477).
|
|
878
|
+
# the marker is a zero-length capture: presence is the signal
|
|
879
|
+
embedded = !parsed[:stage_embedded].nil?
|
|
880
|
+
if !embedded && attributes[:iso_stage]&.match?(/\A[A-Z]+\d+\z/)
|
|
881
|
+
attributes[:iso_stage] = attributes[:iso_stage][/\A[A-Z]+/]
|
|
882
|
+
end
|
|
883
|
+
|
|
871
884
|
# Create typed_stage for ISO stage
|
|
872
885
|
stage_abbr = attributes[:iso_stage]
|
|
873
886
|
if stage_abbr
|
|
@@ -143,7 +143,12 @@ day: nil, iso_stage: nil, iso_iteration: nil)
|
|
|
143
143
|
result = "/D#{version}"
|
|
144
144
|
result += "=#{iso_stage}" if iso_stage
|
|
145
145
|
result += ".#{iso_iteration}" if iso_stage && iso_iteration
|
|
146
|
-
result +=
|
|
146
|
+
result += if revision.to_s.start_with?(".")
|
|
147
|
+
# a captured revision may carry its separator dot
|
|
148
|
+
revision.to_s
|
|
149
|
+
else
|
|
150
|
+
".#{revision}"
|
|
151
|
+
end if revision
|
|
147
152
|
|
|
148
153
|
if year
|
|
149
154
|
# Use original month format to preserve abbreviated vs full names
|
|
@@ -79,10 +79,20 @@ module Pubid
|
|
|
79
79
|
# Canonical format based on lead party
|
|
80
80
|
# @return [Symbol] :ieee or :iso
|
|
81
81
|
def canonical_format
|
|
82
|
-
# A stage-tracked D= designator is IEEE draft notation —
|
|
83
|
-
# canonical face is the designator spelling (§1.3 spelling 7:
|
|
84
|
-
# "JOINT PNUMBER/D=<STAGE>[:year]")
|
|
85
|
-
|
|
82
|
+
# A PARSED stage-tracked D= designator is IEEE draft notation —
|
|
83
|
+
# its canonical face is the designator spelling (§1.3 spelling 7:
|
|
84
|
+
# "JOINT PNUMBER/D=<STAGE>[:year]"). Rows that carry an ISO stage
|
|
85
|
+
# word (from_hash, or stage-led parses) keep the stage-word face
|
|
86
|
+
# no matter what the render derives: their published spelling is
|
|
87
|
+
# "IEEE FCD 15026.3:2010", not a designator (#477).
|
|
88
|
+
if ieee_draft.to_s.start_with?("D=") && iso_stage.to_s.empty?
|
|
89
|
+
return :ieee
|
|
90
|
+
end
|
|
91
|
+
# A stage-word row (parsed stage-led spelling, or a serialized
|
|
92
|
+
# row carrying iso_stage) prints the stage-word face whatever
|
|
93
|
+
# the lead party — the stage word is the printed identity
|
|
94
|
+
# ("IEEE FCD 15026.3:2010", #477).
|
|
95
|
+
return :iso unless iso_stage.to_s.empty?
|
|
86
96
|
|
|
87
97
|
case lead_party
|
|
88
98
|
when "IEEE", "AIEE"
|
|
@@ -143,12 +153,17 @@ module Pubid
|
|
|
143
153
|
# onto the word only for the stages whose printed ISO spellings
|
|
144
154
|
# carry it (CD2, DIS2 — the grammar's multi-digit families);
|
|
145
155
|
# the P project stage is IEEE convention and never prints here.
|
|
146
|
-
# The
|
|
147
|
-
# "
|
|
148
|
-
#
|
|
149
|
-
#
|
|
150
|
-
stage_word = iso_stage
|
|
151
|
-
stage_word = nil if stage_word.empty?
|
|
156
|
+
# The stage word prints verbatim: parsed digit-suffixed
|
|
157
|
+
# spellings ("CD4") are normalized to the bare word with the
|
|
158
|
+
# iteration carried separately at build time, while serialized
|
|
159
|
+
# rows keep the full "DIS2" — both must round-trip (#477).
|
|
160
|
+
stage_word = iso_stage
|
|
161
|
+
stage_word = nil if stage_word.to_s.empty?
|
|
162
|
+
# A serialized row's stage iteration is identity: re-attach it
|
|
163
|
+
# to the printed word ("DIS2 24748.4:2015", #477). The parse
|
|
164
|
+
# path never sets stage_iteration for digit-suffixed spellings.
|
|
165
|
+
iter = stage_iteration.respond_to?(:number) ? stage_iteration.number : stage_iteration
|
|
166
|
+
stage_word = "#{stage_word}#{iter}" if stage_word && iter.to_s.match?(/\A\d+\z/)
|
|
152
167
|
draft_year = nil
|
|
153
168
|
if stage_word.nil? &&
|
|
154
169
|
ieee_draft.to_s.match(/\AD=([A-Z]+)(?:\.(\d+[a-z]?))?(?:[-:](\d{4}))?\z/)
|
|
@@ -174,6 +189,11 @@ module Pubid
|
|
|
174
189
|
result += " (#{parenthetical_content})"
|
|
175
190
|
end
|
|
176
191
|
|
|
192
|
+
# The revision narrative prints after the code: published joint
|
|
193
|
+
# rows carry it as identity spelling ("…:2012(E) Revision of
|
|
194
|
+
# IEEE Std C37.082-1982", #477).
|
|
195
|
+
result += " #{relationships.map(&:to_s).join(' ')}" if relationships && !relationships.empty?
|
|
196
|
+
|
|
177
197
|
result
|
|
178
198
|
end
|
|
179
199
|
|
|
@@ -210,11 +230,9 @@ module Pubid
|
|
|
210
230
|
elsif ieee_draft
|
|
211
231
|
code_str += "/#{ieee_draft}"
|
|
212
232
|
elsif iso_stage
|
|
213
|
-
#
|
|
214
|
-
#
|
|
215
|
-
# ("
|
|
216
|
-
stage = iso_stage.match(/\A([A-Z]+?)(\d+)\z/)
|
|
217
|
-
code_str += stage ? "/D=#{stage[1]}.#{stage[2]}" : "/D=#{iso_stage}"
|
|
233
|
+
# A stage word never converts to a designator on the IEEE
|
|
234
|
+
# face: published stage rows print the stage-word face
|
|
235
|
+
# ("IEEE FCD 15026.3:2010", #477).
|
|
218
236
|
elsif typed_stage&.ieee_draft_equivalent
|
|
219
237
|
code_str += "/#{typed_stage.ieee_draft_equivalent}"
|
|
220
238
|
end
|
data/lib/pubid/version.rb
CHANGED