metanorma / pubid-iso

Implementation of ISO pubid
BSD 2-Clause "Simplified" License
1 stars 0 forks source link

Iteration number should be supported in Amd or Cor #83

Closed ronaldtse closed 2 years ago

ronaldtse commented 2 years ago
irb(main):026:0> Pubid::Iso::Identifier.new(number: 17301, part: 1, publisher: "ISO", language: "en", year: 2016, amendments: [{number: 1, stage:"WD", 
iteration:2}]).to_s
gems/3.1.0/gems/pubid-core-0.2.2/lib/pubid/core/supplement.rb:6:in `initialize': unknown keyword: :iteration (ArgumentError)                                                                                                                                

The correct output is "ISO 17301-1:2016/WD Amd 1.2"

mico commented 2 years ago

@ronaldtse do we have examples of existing identifiers with amendment or corrigendum iteration number? I didn't find any.

ronaldtse commented 2 years ago

Here are some examples to use:

Amendments

ISO 17301-1:2016/NP Amd 1.2
ISO 17301-1:2016/NP Amd 1.2:2022
ISO 17301-1:2016/AWI Amd 1.2
ISO 17301-1:2016/AWI Amd 1.2:2022
ISO 17301-1:2016/WD Amd 1.2
ISO 17301-1:2016/WD Amd 1.2:2022
ISO 17301-1:2016/CD Amd 1.3
ISO 17301-1:2016/CD Amd 1.3:2022
ISO 17301-1:2016/DAmd 1.3
ISO 17301-1:2016/DAmd 1.3:2002
ISO 17301-1:2016/DAM 1.3
ISO 17301-1:2016/DAM 1.3:2002
ISO 17301-1:2016/FDAmd 1.3
ISO 17301-1:2016/FDAM 1.3
ISO 17301-1:2016/FDAmd 1.3:2022
ISO 17301-1:2016/FDAM 1.3:2022
ISO 17301-1:2016/NP Amd 2.2
ISO 17301-1:2016/NP Amd 2.2:2022
ISO 17301-1:2016/AWI Amd 2.2
ISO 17301-1:2016/AWI Amd 2.2:2022
ISO 17301-1:2016/WD Amd 2.2
ISO 17301-1:2016/WD Amd 2.2:2022
ISO 17301-1:2016/CD Amd 2.3
ISO 17301-1:2016/CD Amd 2.3:2022
ISO 17301-1:2016/DAmd 2.3
ISO 17301-1:2016/DAmd 2.3:2002
ISO 17301-1:2016/DAM 2.3
ISO 17301-1:2016/DAM 2.3:2002
ISO 17301-1:2016/FDAmd 2.3
ISO 17301-1:2016/FDAM 2.3
ISO 17301-1:2016/FDAmd 2.3:2022
ISO 17301-1:2016/FDAM 2.3:2022

Cor:

ISO 17301-1:2016/NP Cor 1.2
ISO 17301-1:2016/NP Cor 1.2:2022
ISO 17301-1:2016/AWI Cor 1.2
ISO 17301-1:2016/AWI Cor 1.2:2022
ISO 17301-1:2016/WD Cor 1.2
ISO 17301-1:2016/WD Cor 1.2:2022
ISO 17301-1:2016/CD Cor 1.3
ISO 17301-1:2016/CD Cor 1.3:2022
ISO 17301-1:2016/DCor 1.3
ISO 17301-1:2016/DCor 1.3:2002
ISO 17301-1:2016/DCOR 1.3
ISO 17301-1:2016/DCOR 1.3:2002
ISO 17301-1:2016/FDCor 1.3
ISO 17301-1:2016/FDCOR 1.3
ISO 17301-1:2016/FDCor 1.3:2022
ISO 17301-1:2016/FDCOR 1.3:2022
ISO 17301-1:2016/NP Cor 2.2
ISO 17301-1:2016/NP Cor 2.2:2022
ISO 17301-1:2016/AWI Cor 2.2
ISO 17301-1:2016/AWI Cor 2.2:2022
ISO 17301-1:2016/WD Cor 2.2
ISO 17301-1:2016/WD Cor 2.2:2022
ISO 17301-1:2016/CD Cor 2.3
ISO 17301-1:2016/CD Cor 2.3:2022
ISO 17301-1:2016/DCor 2.3
ISO 17301-1:2016/DCor 2.3:2002
ISO 17301-1:2016/COR 2.3
ISO 17301-1:2016/COR 2.3:2002
ISO 17301-1:2016/FDCor 2.3
ISO 17301-1:2016/FCOR 2.3
ISO 17301-1:2016/FDCor 2.3:2022
ISO 17301-1:2016/FCOR 2.3:2022

But these should raise errors because status = :published does not accept iteration.

ISO 17301-1:2016/Amd 2.3
ISO 17301-1:2016/Amd 2.3:2022
ISO 17301-1:2016/AMD 2.3
ISO 17301-1:2016/AMD 2.3:2022
ISO 17301-1:2016/Cor 2.3
ISO 17301-1:2016/Cor 2.3:2022
ISO 17301-1:2016/COR 2.3
ISO 17301-1:2016/COR 2.3:2022