pubid 2.0.0.pre.alpha.38 → 2.0.0.pre.alpha.39

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e167bcdea8ccdc856546623449ce7ecb5662e48105794db9f36026b8d577f300
4
- data.tar.gz: fdc189199738c34551faa29b7aa7abf0ccbdc006ef9aa5c1ae62b3f404b64cce
3
+ metadata.gz: e53b03c87c2a04f877d8eba11d5689984de9c0af641258c68c8c03377d762f12
4
+ data.tar.gz: 5bdad1686cf8cd3709ea1494eef8c78dd7c6974bae2802ccc669db939f788731
5
5
  SHA512:
6
- metadata.gz: bd79b71b7fd2b457d78f225d3cc37eb2280a56b32aa24e604b14d8aa66f4f14812915d960769c4c69668f8c5b6b17d67f24399683c4e4dd6f0dd84b5ca882bd8
7
- data.tar.gz: b0ce6c4e2d05416fc0ec1f77a29291bce32380efd13162ff62406bff78a60dc77c0b5404f3b61f036d868bc6b1f2c84003961cc6710b45ac0712facf6b972355
6
+ metadata.gz: 822faa7030a35d1e87901785b0d22bb0716c1b997985c6b9d616c1eb75f3e7fe3436ca61c427c4d8abd44d14fe2e173b7a8c5ab3bc26941bb68e75f308862965
7
+ data.tar.gz: e636567ecb22497f4cf0c0cafdfe68d06f83e593bc15483c168cbc25053a61221d6738ac16730f2bbe0e05c88ce6d91bb3166da7386ac1ca4004363fea390a5a
@@ -155,7 +155,9 @@ ISO/IEC/IEEE CD P26513/D1, August 2015: ISO/IEC/IEEE P26513/D1, August 2015
155
155
  "ISO/IEC/IEEE DIS P16326/201x, December 2018": "ISO/IEC/IEEE DIS P16326-2018-12"
156
156
  "ISO/IEC/IEEE/P21839, 2019(E)": "ISO/IEC/IEEE P21839-2019"
157
157
  "ISO/IEC/IEEE CD2 P12207-2: 201x(E), February 2019": "ISO/IEC/IEEE CD2 P12207.2-2019-02"
158
- "ISO/IEC/IEEE P42010.WD4:2019(E)": "ISO/IEC/IEEE P42010/D-4-2019"
158
+ # The glued WD iteration re-spells to the face that canonicalises in one
159
+ # round ("P42010/D-4-2019" renders "P42010.2019/D4", a second round).
160
+ "ISO/IEC/IEEE P42010.WD4:2019(E)": "ISO/IEC/IEEE P42010.2019/D4"
159
161
  # the grammar parses the raw `_CDV/V3, Month YYYY` spelling directly
160
162
  # (joint_development_ieee_format slash-stage branch) — no shim needed
161
163
  "ISO/IEC/IEEE/P16085_DIS, March 2020": "ISO/IEC/IEEE DIS P16085-2020-03"
@@ -16,7 +16,7 @@ module Pubid
16
16
  "Jun" => "06", "Jul" => "07", "Aug" => "08", "Sep" => "09",
17
17
  "Oct" => "10", "Nov" => "11", "Dec" => "12",
18
18
  }.freeze
19
- attr_accessor :original_input
19
+ attr_accessor :original_input, :parser_input
20
20
  attr_reader :identifier_class
21
21
 
22
22
  def initialize(identifier_class = Identifier)
@@ -1535,10 +1535,12 @@ module Pubid
1535
1535
  type_value = "Std" if type_value == "Standard"
1536
1536
  draft_status_value = extract_value(parsed[:draft_status])
1537
1537
 
1538
- # Handle case where parser captured number without "P" prefix
1539
- # Check original input to see if there was a P before the number
1540
- # The ieee_p_identifier rule consumes P without capturing it
1541
- if !type_value && original_input&.match?(/IEEE\s+P/)
1538
+ # Handle case where parser captured number without "P" prefix.
1539
+ # The parser sees the NORMALIZED spelling: a rewrite that moves
1540
+ # the project P behind a re-spelled type word ("IEEE
1541
+ # PC37.30.2/D03 Rev 8" -> "IEEE Draft PC37.30.2Rev8/D03") must
1542
+ # not be re-read as a project marker from the raw input.
1543
+ if !type_value && parser_input&.match?(/IEEE\s+P/)
1542
1544
  type_value = "P"
1543
1545
  end
1544
1546
 
@@ -384,10 +384,12 @@ module Pubid
384
384
  result = PreParser.preprocess(normalized)
385
385
  return build_dual(result.parts) if result.dispatch == :dual_semicolon
386
386
  end
387
- parsed = Pubid::Parg::Backend.parse(:ieee, Parser.normalize_input(normalized))
387
+ parser_input = Parser.normalize_input(normalized)
388
+ parsed = Pubid::Parg::Backend.parse(:ieee, parser_input)
388
389
  builder = Builder.new(Identifier)
389
390
  # Pass the original input string to builder for context
390
391
  builder.original_input = input
392
+ builder.parser_input = parser_input
391
393
  builder.build(parsed)
392
394
  end
393
395
 
@@ -1295,6 +1295,39 @@ module Pubid
1295
1295
  # them to the generic standard face with a slashed copublisher.
1296
1296
  cleaned = cleaned.gsub(%r{((?:IEEE|ISO|IEC)(?:/(?:IEEE|ISO|IEC|CSA))+)\s+Draft\s+(P[A-Z0-9][A-Z0-9.-]*/D=[A-Z])}, '\1 \2')
1297
1297
  cleaned = cleaned.gsub(%r{(IEEE|ISO|IEC)//}, '\1/')
1298
+ # The three-way ISO-led list glues the language marker to the
1299
+ # year ("ISO/IEC/IEEE 8802-1AC-2018(E)"): the spaced spelling is
1300
+ # read as the language marker and dropped, the glued one falls
1301
+ # into parenthetical content and prints. Re-spell the boundary.
1302
+ # Scoped to the three-way lists: the two-way IEC/IEEE copublished
1303
+ # form keeps its glued (E) as identity ("…:2012(E)").
1304
+ cleaned = cleaned.gsub(
1305
+ %r{\A((?:ISO/IEC/IEEE|IEEE/ISO/IEC|IEEE/IEC/ISO)\s+[^()]+?[^()\s])\(E\)\z},
1306
+ '\1 (E)',
1307
+ )
1308
+ # The stage-first joint draft's dash part carries a bare comma
1309
+ # year ("IEC/IEEE FDIS P60780-323, 2015"): the joint route takes
1310
+ # no bare year there and the copublished route claims the string,
1311
+ # so drop the non-identity year and let the stage-first route
1312
+ # read the dash part (the rendered face is the dot human).
1313
+ cleaned = cleaned.gsub(
1314
+ %r{\A((?:IEC/IEEE|IEEE/IEC)\s+(?:FDIS|FCD|CDV|DIS|CD|WD|PWI|NP)\s+P\d+(?:-\d+)+),\s+\d{4}\z},
1315
+ '\1',
1316
+ )
1317
+ # A two-digit draft designator spelled without its D
1318
+ # ("IEEE P1052/08, September 2018"): the corpus face is the D
1319
+ # ordinal ("…/D08").
1320
+ cleaned = cleaned.gsub(
1321
+ %r{\AIEEE\s+(P[\d.-]+)/(\d{2}),\s+([A-Za-z]+)\s+(\d{4})\z},
1322
+ 'IEEE \1/D\2, \3 \4',
1323
+ )
1324
+ # The revision word rides after the draft ordinal
1325
+ # ("IEEE PC37.30.2/D03 Rev 8, October 2013"): move it onto the
1326
+ # number and mark the document as the draft it spells.
1327
+ cleaned = cleaned.gsub(
1328
+ %r{\AIEEE\s+((?:P)?C?[\d.]+)/D(\d+)\s+Rev\s+(\d+),\s+([A-Za-z]+)\s+(\d{4})\z},
1329
+ 'IEEE Draft \1Rev\3/D\2, \4 \5',
1330
+ )
1298
1331
  # The IEEE-led joint list's dash/underscore stage tail carries a
1299
1332
  # month-name date ("IEEE/ISO/IEC P29119-2-DIS, December 2011",
1300
1333
  # "IEEE/ISO/IEC P29119-4_FDIS, December 2020"). The generic route
data/lib/pubid/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pubid
4
- VERSION = "2.0.0.pre.alpha.38"
4
+ VERSION = "2.0.0.pre.alpha.39"
5
5
  end
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.0.pre.alpha.38
4
+ version: 2.0.0.pre.alpha.39
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.