pubid 1.15.19 → 2.0.0.pre.alpha.2
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/LICENSE.txt +1 -1
- data/README.adoc +2041 -53
- data/archived-gems/pubid-ccsds/update_codes.yaml +1 -0
- data/archived-gems/pubid-iec/stages.yaml +129 -0
- data/archived-gems/pubid-iec/update_codes.yaml +67 -0
- data/archived-gems/pubid-ieee/update_codes.yaml +104 -0
- data/archived-gems/pubid-iso/stages.yaml +106 -0
- data/archived-gems/pubid-iso/update_codes.yaml +4 -0
- data/archived-gems/pubid-itu/i18n.yaml +13 -0
- data/archived-gems/pubid-itu/series.yaml +42 -0
- data/archived-gems/pubid-nist/publishers.yaml +6 -0
- data/archived-gems/pubid-nist/series.yaml +121 -0
- data/archived-gems/pubid-nist/stages.yaml +16 -0
- data/archived-gems/pubid-nist/update_codes.yaml +93 -0
- data/archived-gems/pubid-plateau/update_codes.yaml +6 -0
- data/data/ccsds/update_codes.yaml +1 -0
- data/data/iec/update_codes.yaml +67 -0
- data/data/ieee/update_codes.yaml +104 -0
- data/data/iso/update_codes.yaml +21 -0
- data/data/nist/update_codes.yaml +89 -0
- data/data/plateau/update_codes.yaml +6 -0
- data/lib/pubid/amca/builder.rb +176 -0
- data/lib/pubid/amca/identifier.rb +57 -0
- data/lib/pubid/amca/identifiers/base.rb +64 -0
- data/lib/pubid/amca/identifiers/interpretation.rb +51 -0
- data/lib/pubid/amca/identifiers/publication.rb +47 -0
- data/lib/pubid/amca/identifiers/standard.rb +22 -0
- data/lib/pubid/amca/identifiers.rb +12 -0
- data/lib/pubid/amca/parser.rb +153 -0
- data/lib/pubid/amca/scheme.rb +16 -0
- data/lib/pubid/amca/single_identifier.rb +33 -0
- data/lib/pubid/amca/urn_generator.rb +50 -0
- data/lib/pubid/amca.rb +26 -0
- data/lib/pubid/ansi/builder.rb +52 -0
- data/lib/pubid/ansi/identifier.rb +55 -0
- data/lib/pubid/ansi/identifiers/american_national_standard.rb +12 -0
- data/lib/pubid/ansi/identifiers/standard.rb +16 -0
- data/lib/pubid/ansi/identifiers.rb +11 -0
- data/lib/pubid/ansi/parser.rb +91 -0
- data/lib/pubid/ansi/scheme.rb +15 -0
- data/lib/pubid/ansi/single_identifier.rb +45 -0
- data/lib/pubid/ansi/urn_generator.rb +76 -0
- data/lib/pubid/ansi.rb +27 -0
- data/lib/pubid/api/builder.rb +85 -0
- data/lib/pubid/api/components/code.rb +9 -0
- data/lib/pubid/api/identifier.rb +68 -0
- data/lib/pubid/api/identifiers/base.rb +24 -0
- data/lib/pubid/api/identifiers/bulletin.rb +15 -0
- data/lib/pubid/api/identifiers/continuous_operations_standard.rb +15 -0
- data/lib/pubid/api/identifiers/mpms.rb +44 -0
- data/lib/pubid/api/identifiers/publication.rb +15 -0
- data/lib/pubid/api/identifiers/recommended_practice.rb +15 -0
- data/lib/pubid/api/identifiers/specification.rb +15 -0
- data/lib/pubid/api/identifiers/standard.rb +15 -0
- data/lib/pubid/api/identifiers/technical_report.rb +15 -0
- data/lib/pubid/api/identifiers/typeless_standard.rb +27 -0
- data/lib/pubid/api/parser.rb +140 -0
- data/lib/pubid/api/scheme.rb +66 -0
- data/lib/pubid/api/single_identifier.rb +46 -0
- data/lib/pubid/api/urn_generator.rb +41 -0
- data/lib/pubid/api.rb +17 -0
- data/lib/pubid/ashrae/builder.rb +498 -0
- data/lib/pubid/ashrae/identifier.rb +57 -0
- data/lib/pubid/ashrae/identifiers/addenda_package.rb +46 -0
- data/lib/pubid/ashrae/identifiers/addendum.rb +55 -0
- data/lib/pubid/ashrae/identifiers/base.rb +23 -0
- data/lib/pubid/ashrae/identifiers/combined_addenda.rb +51 -0
- data/lib/pubid/ashrae/identifiers/errata.rb +40 -0
- data/lib/pubid/ashrae/identifiers/guideline.rb +38 -0
- data/lib/pubid/ashrae/identifiers/interpretation.rb +39 -0
- data/lib/pubid/ashrae/identifiers/standard.rb +38 -0
- data/lib/pubid/ashrae/identifiers.rb +16 -0
- data/lib/pubid/ashrae/parser.rb +724 -0
- data/lib/pubid/ashrae/scheme.rb +53 -0
- data/lib/pubid/ashrae/single_identifier.rb +23 -0
- data/lib/pubid/ashrae/supplement_identifier.rb +23 -0
- data/lib/pubid/ashrae/urn_generator.rb +59 -0
- data/lib/pubid/ashrae.rb +21 -0
- data/lib/pubid/asme/builder.rb +153 -0
- data/lib/pubid/asme/components/code.rb +18 -0
- data/lib/pubid/asme/identifier.rb +61 -0
- data/lib/pubid/asme/identifiers/base.rb +70 -0
- data/lib/pubid/asme/identifiers/standard.rb +12 -0
- data/lib/pubid/asme/identifiers.rb +10 -0
- data/lib/pubid/asme/parser.rb +308 -0
- data/lib/pubid/asme/scheme.rb +37 -0
- data/lib/pubid/asme/single_identifier.rb +29 -0
- data/lib/pubid/asme/urn_generator.rb +133 -0
- data/lib/pubid/asme.rb +21 -0
- data/lib/pubid/astm/builder.rb +159 -0
- data/lib/pubid/astm/components/code.rb +33 -0
- data/lib/pubid/astm/identifier.rb +92 -0
- data/lib/pubid/astm/identifiers/adjunct.rb +21 -0
- data/lib/pubid/astm/identifiers/base.rb +13 -0
- data/lib/pubid/astm/identifiers/data_series.rb +25 -0
- data/lib/pubid/astm/identifiers/iso_dual_published.rb +74 -0
- data/lib/pubid/astm/identifiers/manual.rb +40 -0
- data/lib/pubid/astm/identifiers/monograph.rb +25 -0
- data/lib/pubid/astm/identifiers/research_report.rb +18 -0
- data/lib/pubid/astm/identifiers/standard.rb +52 -0
- data/lib/pubid/astm/identifiers/technical_report.rb +23 -0
- data/lib/pubid/astm/identifiers/work_in_progress.rb +21 -0
- data/lib/pubid/astm/parser.rb +244 -0
- data/lib/pubid/astm/scheme.rb +55 -0
- data/lib/pubid/astm/single_identifier.rb +25 -0
- data/lib/pubid/astm/urn_generator.rb +99 -0
- data/lib/pubid/astm.rb +38 -0
- data/lib/pubid/bsi/builder.rb +1483 -0
- data/lib/pubid/bsi/components/code.rb +11 -0
- data/lib/pubid/bsi/components/date.rb +11 -0
- data/lib/pubid/bsi/components/publisher.rb +11 -0
- data/lib/pubid/bsi/components/type.rb +11 -0
- data/lib/pubid/bsi/identifier.rb +87 -0
- data/lib/pubid/bsi/identifiers/addendum_document.rb +64 -0
- data/lib/pubid/bsi/identifiers/adopted_european_norm.rb +95 -0
- data/lib/pubid/bsi/identifiers/adopted_international_standard.rb +82 -0
- data/lib/pubid/bsi/identifiers/aerospace_standard.rb +118 -0
- data/lib/pubid/bsi/identifiers/amendment.rb +40 -0
- data/lib/pubid/bsi/identifiers/base.rb +11 -0
- data/lib/pubid/bsi/identifiers/british_industrial_practice.rb +27 -0
- data/lib/pubid/bsi/identifiers/british_standard.rb +33 -0
- data/lib/pubid/bsi/identifiers/bundled_identifier.rb +114 -0
- data/lib/pubid/bsi/identifiers/committee_document.rb +51 -0
- data/lib/pubid/bsi/identifiers/consolidated_identifier.rb +152 -0
- data/lib/pubid/bsi/identifiers/corrigendum.rb +28 -0
- data/lib/pubid/bsi/identifiers/detailed_specification.rb +69 -0
- data/lib/pubid/bsi/identifiers/disc.rb +56 -0
- data/lib/pubid/bsi/identifiers/draft_document.rb +71 -0
- data/lib/pubid/bsi/identifiers/electronic_book.rb +52 -0
- data/lib/pubid/bsi/identifiers/expert_commentary.rb +47 -0
- data/lib/pubid/bsi/identifiers/explanatory_supplement.rb +82 -0
- data/lib/pubid/bsi/identifiers/flex.rb +61 -0
- data/lib/pubid/bsi/identifiers/handbook.rb +39 -0
- data/lib/pubid/bsi/identifiers/index.rb +62 -0
- data/lib/pubid/bsi/identifiers/method.rb +76 -0
- data/lib/pubid/bsi/identifiers/national_annex.rb +73 -0
- data/lib/pubid/bsi/identifiers/practice_guide.rb +27 -0
- data/lib/pubid/bsi/identifiers/publicly_available_specification.rb +79 -0
- data/lib/pubid/bsi/identifiers/published_document.rb +79 -0
- data/lib/pubid/bsi/identifiers/section.rb +62 -0
- data/lib/pubid/bsi/identifiers/set.rb +46 -0
- data/lib/pubid/bsi/identifiers/standalone_amendment.rb +40 -0
- data/lib/pubid/bsi/identifiers/supplement_document.rb +51 -0
- data/lib/pubid/bsi/identifiers/supplementary_index.rb +81 -0
- data/lib/pubid/bsi/identifiers/technical_specification.rb +79 -0
- data/lib/pubid/bsi/identifiers/test_method.rb +67 -0
- data/lib/pubid/bsi/identifiers/value_added_publication.rb +52 -0
- data/lib/pubid/bsi/identifiers.rb +52 -0
- data/lib/pubid/bsi/model.rb +196 -0
- data/lib/pubid/bsi/parser.rb +659 -0
- data/lib/pubid/bsi/scheme.rb +243 -0
- data/lib/pubid/bsi/single_identifier.rb +129 -0
- data/lib/pubid/bsi/urn_generator.rb +84 -0
- data/lib/pubid/bsi.rb +32 -0
- data/lib/pubid/builder/base.rb +138 -0
- data/lib/pubid/bundled_identifier.rb +126 -0
- data/lib/pubid/ccsds/builder.rb +56 -0
- data/lib/pubid/ccsds/identifier.rb +84 -0
- data/lib/pubid/ccsds/identifiers/base.rb +89 -0
- data/lib/pubid/ccsds/identifiers/base_BASE_88929.rb +70 -0
- data/lib/pubid/ccsds/identifiers/corrigendum.rb +39 -0
- data/lib/pubid/ccsds/identifiers.rb +10 -0
- data/lib/pubid/ccsds/parser.rb +71 -0
- data/lib/pubid/ccsds/scheme.rb +57 -0
- data/lib/pubid/ccsds/single_identifier.rb +77 -0
- data/lib/pubid/ccsds/supplement_identifier.rb +33 -0
- data/lib/pubid/ccsds/urn_generator.rb +115 -0
- data/lib/pubid/ccsds.rb +21 -0
- data/lib/pubid/cen_cenelec/builder.rb +330 -0
- data/lib/pubid/cen_cenelec/identifier.rb +52 -0
- data/lib/pubid/cen_cenelec/identifiers/adopted_european_norm.rb +40 -0
- data/lib/pubid/cen_cenelec/identifiers/amendment.rb +29 -0
- data/lib/pubid/cen_cenelec/identifiers/base.rb +75 -0
- data/lib/pubid/cen_cenelec/identifiers/cen_report.rb +28 -0
- data/lib/pubid/cen_cenelec/identifiers/cen_workshop_agreement.rb +27 -0
- data/lib/pubid/cen_cenelec/identifiers/cenelec_harmonization_document.rb +28 -0
- data/lib/pubid/cen_cenelec/identifiers/consolidated_identifier.rb +61 -0
- data/lib/pubid/cen_cenelec/identifiers/corrigendum.rb +35 -0
- data/lib/pubid/cen_cenelec/identifiers/european_norm.rb +41 -0
- data/lib/pubid/cen_cenelec/identifiers/european_prestandard.rb +37 -0
- data/lib/pubid/cen_cenelec/identifiers/european_specification.rb +28 -0
- data/lib/pubid/cen_cenelec/identifiers/fragment.rb +22 -0
- data/lib/pubid/cen_cenelec/identifiers/guide.rb +27 -0
- data/lib/pubid/cen_cenelec/identifiers/harmonization_document.rb +27 -0
- data/lib/pubid/cen_cenelec/identifiers/technical_report.rb +27 -0
- data/lib/pubid/cen_cenelec/identifiers/technical_specification.rb +35 -0
- data/lib/pubid/cen_cenelec/identifiers.rb +32 -0
- data/lib/pubid/cen_cenelec/parser.rb +144 -0
- data/lib/pubid/cen_cenelec/scheme.rb +164 -0
- data/lib/pubid/cen_cenelec/single_identifier.rb +130 -0
- data/lib/pubid/cen_cenelec/supplement_identifier.rb +48 -0
- data/lib/pubid/cen_cenelec/urn_generator.rb +129 -0
- data/lib/pubid/cen_cenelec.rb +21 -0
- data/lib/pubid/cie/builder.rb +399 -0
- data/lib/pubid/cie/components/code.rb +72 -0
- data/lib/pubid/cie/components/language.rb +58 -0
- data/lib/pubid/cie/identifier.rb +71 -0
- data/lib/pubid/cie/identifiers/bundle.rb +20 -0
- data/lib/pubid/cie/identifiers/conference.rb +32 -0
- data/lib/pubid/cie/identifiers/corrigendum.rb +40 -0
- data/lib/pubid/cie/identifiers/dual_published.rb +41 -0
- data/lib/pubid/cie/identifiers/identical.rb +64 -0
- data/lib/pubid/cie/identifiers/joint_published.rb +52 -0
- data/lib/pubid/cie/identifiers/standard.rb +58 -0
- data/lib/pubid/cie/identifiers/supplement.rb +45 -0
- data/lib/pubid/cie/identifiers/tutorial_bundle.rb +20 -0
- data/lib/pubid/cie/identifiers.rb +17 -0
- data/lib/pubid/cie/parser.rb +347 -0
- data/lib/pubid/cie/scheme.rb +64 -0
- data/lib/pubid/cie/single_identifier.rb +30 -0
- data/lib/pubid/cie/supplement_identifier.rb +26 -0
- data/lib/pubid/cie/urn_generator.rb +123 -0
- data/lib/pubid/cie.rb +28 -0
- data/lib/pubid/components/code.rb +33 -0
- data/lib/pubid/components/date.rb +49 -0
- data/lib/pubid/components/edition.rb +32 -0
- data/lib/pubid/components/factory.rb +50 -0
- data/lib/pubid/components/language.rb +37 -0
- data/lib/pubid/components/locality.rb +10 -0
- data/lib/pubid/components/publisher.rb +36 -0
- data/lib/pubid/components/stage.rb +54 -0
- data/lib/pubid/components/type.rb +58 -0
- data/lib/pubid/components/typed_stage.rb +59 -0
- data/lib/pubid/components.rb +16 -0
- data/lib/pubid/core/pattern_doc_generator.rb +272 -0
- data/lib/pubid/core/update_codes.rb +77 -0
- data/lib/pubid/core.rb +8 -0
- data/lib/pubid/csa/builder.rb +671 -0
- data/lib/pubid/csa/components/code.rb +9 -0
- data/lib/pubid/csa/components.rb +9 -0
- data/lib/pubid/csa/composite_identifier.rb +27 -0
- data/lib/pubid/csa/identifier.rb +513 -0
- data/lib/pubid/csa/identifiers/base.rb +133 -0
- data/lib/pubid/csa/identifiers/bundled.rb +125 -0
- data/lib/pubid/csa/identifiers/canadian_adopted.rb +82 -0
- data/lib/pubid/csa/identifiers/cec.rb +129 -0
- data/lib/pubid/csa/identifiers/combined.rb +130 -0
- data/lib/pubid/csa/identifiers/csa_adopted.rb +78 -0
- data/lib/pubid/csa/identifiers/package.rb +65 -0
- data/lib/pubid/csa/identifiers/series.rb +127 -0
- data/lib/pubid/csa/identifiers/standard.rb +10 -0
- data/lib/pubid/csa/identifiers.rb +17 -0
- data/lib/pubid/csa/parser.rb +445 -0
- data/lib/pubid/csa/scheme.rb +44 -0
- data/lib/pubid/csa/single_identifier.rb +30 -0
- data/lib/pubid/csa/urn_generator.rb +80 -0
- data/lib/pubid/csa/wrapper_identifier.rb +31 -0
- data/lib/pubid/csa.rb +25 -0
- data/lib/pubid/etsi/builder.rb +133 -0
- data/lib/pubid/etsi/components/code.rb +42 -0
- data/lib/pubid/etsi/components/version.rb +37 -0
- data/lib/pubid/etsi/components.rb +10 -0
- data/lib/pubid/etsi/identifier.rb +57 -0
- data/lib/pubid/etsi/identifiers/amendment.rb +15 -0
- data/lib/pubid/etsi/identifiers/base.rb +38 -0
- data/lib/pubid/etsi/identifiers/corrigendum.rb +15 -0
- data/lib/pubid/etsi/identifiers/etsi_standard.rb +19 -0
- data/lib/pubid/etsi/identifiers/supplement_identifier.rb +91 -0
- data/lib/pubid/etsi/identifiers.rb +14 -0
- data/lib/pubid/etsi/parser.rb +133 -0
- data/lib/pubid/etsi/scheme.rb +42 -0
- data/lib/pubid/etsi/urn_generator.rb +76 -0
- data/lib/pubid/etsi.rb +21 -0
- data/lib/pubid/export/auditor.rb +89 -0
- data/lib/pubid/export/data_class_exporter.rb +59 -0
- data/lib/pubid/export/exporter.rb +74 -0
- data/lib/pubid/export/flavor_exporter.rb +402 -0
- data/lib/pubid/export/ieee_exporter.rb +78 -0
- data/lib/pubid/export/itu_exporter.rb +66 -0
- data/lib/pubid/export/nist_exporter.rb +64 -0
- data/lib/pubid/export/registry_exporter.rb +90 -0
- data/lib/pubid/export/result.rb +97 -0
- data/lib/pubid/export/scheme_exporter.rb +70 -0
- data/lib/pubid/export.rb +18 -0
- data/lib/pubid/format_detector.rb +16 -0
- data/lib/pubid/format_registry.rb +42 -0
- data/lib/pubid/identifier.rb +242 -0
- data/lib/pubid/identifier_metadata.rb +148 -0
- data/lib/pubid/identifier_registry.rb +198 -0
- data/lib/pubid/idf/builder.rb +82 -0
- data/lib/pubid/idf/identifier.rb +129 -0
- data/lib/pubid/idf/identifiers/amendment.rb +27 -0
- data/lib/pubid/idf/identifiers/corrigendum.rb +27 -0
- data/lib/pubid/idf/identifiers/international_standard.rb +123 -0
- data/lib/pubid/idf/identifiers/reviewed_method.rb +100 -0
- data/lib/pubid/idf/identifiers.rb +13 -0
- data/lib/pubid/idf/parser.rb +143 -0
- data/lib/pubid/idf/scheme.rb +61 -0
- data/lib/pubid/idf/single_identifier.rb +19 -0
- data/lib/pubid/idf/supplement_identifier.rb +43 -0
- data/lib/pubid/idf/urn_generator.rb +84 -0
- data/lib/pubid/idf.rb +25 -0
- data/lib/pubid/iec/builder.rb +458 -0
- data/lib/pubid/iec/components/code.rb +60 -0
- data/lib/pubid/iec/components/consolidated_amendment.rb +59 -0
- data/lib/pubid/iec/components/publisher.rb +36 -0
- data/lib/pubid/iec/components/sheet.rb +32 -0
- data/lib/pubid/iec/components/trf_info.rb +38 -0
- data/lib/pubid/iec/components/vap_suffix.rb +41 -0
- data/lib/pubid/iec/identifier.rb +256 -0
- data/lib/pubid/iec/identifiers/amendment.rb +94 -0
- data/lib/pubid/iec/identifiers/base.rb +82 -0
- data/lib/pubid/iec/identifiers/component_specification.rb +39 -0
- data/lib/pubid/iec/identifiers/conformity_assessment.rb +39 -0
- data/lib/pubid/iec/identifiers/consolidated_identifier.rb +82 -0
- data/lib/pubid/iec/identifiers/corrigendum.rb +94 -0
- data/lib/pubid/iec/identifiers/fragment_identifier.rb +137 -0
- data/lib/pubid/iec/identifiers/guide.rb +104 -0
- data/lib/pubid/iec/identifiers/international_standard.rb +147 -0
- data/lib/pubid/iec/identifiers/interpretation_sheet.rb +104 -0
- data/lib/pubid/iec/identifiers/operational_document.rb +39 -0
- data/lib/pubid/iec/identifiers/publicly_available_specification.rb +101 -0
- data/lib/pubid/iec/identifiers/sheet_identifier.rb +62 -0
- data/lib/pubid/iec/identifiers/societal_technology_trend_report.rb +40 -0
- data/lib/pubid/iec/identifiers/systems_reference_document.rb +40 -0
- data/lib/pubid/iec/identifiers/technical_report.rb +132 -0
- data/lib/pubid/iec/identifiers/technical_specification.rb +132 -0
- data/lib/pubid/iec/identifiers/technology_report.rb +39 -0
- data/lib/pubid/iec/identifiers/test_report_form.rb +78 -0
- data/lib/pubid/iec/identifiers/vap_identifier.rb +73 -0
- data/lib/pubid/iec/identifiers/white_paper.rb +39 -0
- data/lib/pubid/iec/identifiers/working_document.rb +96 -0
- data/lib/pubid/iec/parser.rb +417 -0
- data/lib/pubid/iec/rendering_style.rb +113 -0
- data/lib/pubid/iec/scheme.rb +71 -0
- data/lib/pubid/iec/single_identifier.rb +80 -0
- data/lib/pubid/iec/supplement_identifier.rb +161 -0
- data/lib/pubid/iec/urn_generator.rb +79 -0
- data/lib/pubid/iec/urn_parser.rb +90 -0
- data/lib/pubid/iec.rb +85 -0
- data/lib/pubid/ieee/aiee/builder.rb +71 -0
- data/lib/pubid/ieee/aiee/identifier.rb +105 -0
- data/lib/pubid/ieee/aiee/parser.rb +130 -0
- data/lib/pubid/ieee/aiee.rb +11 -0
- data/lib/pubid/ieee/builder.rb +1237 -0
- data/lib/pubid/ieee/components/code.rb +102 -0
- data/lib/pubid/ieee/components/draft.rb +93 -0
- data/lib/pubid/ieee/components/relationship.rb +157 -0
- data/lib/pubid/ieee/components/typed_stage.rb +100 -0
- data/lib/pubid/ieee/identifier.rb +54 -0
- data/lib/pubid/ieee/identifiers/adopted_standard.rb +33 -0
- data/lib/pubid/ieee/identifiers/base.rb +591 -0
- data/lib/pubid/ieee/identifiers/conformance_identifier.rb +35 -0
- data/lib/pubid/ieee/identifiers/corrigendum.rb +37 -0
- data/lib/pubid/ieee/identifiers/csa_dual_published.rb +51 -0
- data/lib/pubid/ieee/identifiers/dual_identifier.rb +18 -0
- data/lib/pubid/ieee/identifiers/dual_published.rb +28 -0
- data/lib/pubid/ieee/identifiers/iec_ieee_copublished.rb +27 -0
- data/lib/pubid/ieee/identifiers/interpretation_identifier.rb +34 -0
- data/lib/pubid/ieee/identifiers/joint_development.rb +172 -0
- data/lib/pubid/ieee/identifiers/multi_numbered_identifier.rb +51 -0
- data/lib/pubid/ieee/identifiers/nesc/base.rb +56 -0
- data/lib/pubid/ieee/identifiers/nesc/draft.rb +28 -0
- data/lib/pubid/ieee/identifiers/nesc/handbook.rb +32 -0
- data/lib/pubid/ieee/identifiers/nesc/redline.rb +26 -0
- data/lib/pubid/ieee/identifiers/nesc/standard.rb +26 -0
- data/lib/pubid/ieee/identifiers/nesc.rb +15 -0
- data/lib/pubid/ieee/identifiers/parenthetical_identifier.rb +20 -0
- data/lib/pubid/ieee/identifiers/project_draft_identifier.rb +26 -0
- data/lib/pubid/ieee/identifiers/redlined_standard.rb +33 -0
- data/lib/pubid/ieee/identifiers/si_standard.rb +73 -0
- data/lib/pubid/ieee/identifiers/standard.rb +41 -0
- data/lib/pubid/ieee/identifiers/supplement_identifier.rb +23 -0
- data/lib/pubid/ieee/identifiers.rb +33 -0
- data/lib/pubid/ieee/ire/builder.rb +61 -0
- data/lib/pubid/ieee/ire/identifier.rb +58 -0
- data/lib/pubid/ieee/ire/parser.rb +91 -0
- data/lib/pubid/ieee/ire.rb +11 -0
- data/lib/pubid/ieee/nesc/builder.rb +101 -0
- data/lib/pubid/ieee/nesc/parser.rb +154 -0
- data/lib/pubid/ieee/nesc.rb +10 -0
- data/lib/pubid/ieee/parser.rb +1226 -0
- data/lib/pubid/ieee/scheme.rb +90 -0
- data/lib/pubid/ieee/typed_stages.rb +172 -0
- data/lib/pubid/ieee/urn_generator.rb +188 -0
- data/lib/pubid/ieee.rb +32 -0
- data/lib/pubid/ieee_debug.rb +31 -0
- data/lib/pubid/iho/builder.rb +37 -0
- data/lib/pubid/iho/identifier.rb +61 -0
- data/lib/pubid/iho/identifiers/base.rb +41 -0
- data/lib/pubid/iho/identifiers/bibliographic.rb +16 -0
- data/lib/pubid/iho/identifiers/circular_letter.rb +15 -0
- data/lib/pubid/iho/identifiers/miscellaneous.rb +16 -0
- data/lib/pubid/iho/identifiers/publication.rb +15 -0
- data/lib/pubid/iho/identifiers/standard.rb +15 -0
- data/lib/pubid/iho/identifiers.rb +14 -0
- data/lib/pubid/iho/parser.rb +68 -0
- data/lib/pubid/iho/scheme.rb +29 -0
- data/lib/pubid/iho/urn_generator.rb +29 -0
- data/lib/pubid/iho.rb +21 -0
- data/lib/pubid/iso/builder.rb +309 -0
- data/lib/pubid/iso/bundled_identifier.rb +85 -0
- data/lib/pubid/iso/combined_identifier.rb +22 -0
- data/lib/pubid/iso/components/code.rb +36 -0
- data/lib/pubid/iso/components/publisher.rb +60 -0
- data/lib/pubid/iso/components.rb +12 -0
- data/lib/pubid/iso/format_resolver.rb +45 -0
- data/lib/pubid/iso/identifier.rb +330 -0
- data/lib/pubid/iso/identifiers/addendum.rb +104 -0
- data/lib/pubid/iso/identifiers/amendment.rb +128 -0
- data/lib/pubid/iso/identifiers/base.rb +115 -0
- data/lib/pubid/iso/identifiers/corrigendum.rb +108 -0
- data/lib/pubid/iso/identifiers/data.rb +76 -0
- data/lib/pubid/iso/identifiers/directives.rb +59 -0
- data/lib/pubid/iso/identifiers/directives_supplement.rb +119 -0
- data/lib/pubid/iso/identifiers/extract.rb +30 -0
- data/lib/pubid/iso/identifiers/guide.rb +100 -0
- data/lib/pubid/iso/identifiers/international_standard.rb +168 -0
- data/lib/pubid/iso/identifiers/international_standardized_profile.rb +94 -0
- data/lib/pubid/iso/identifiers/international_workshop_agreement.rb +89 -0
- data/lib/pubid/iso/identifiers/pas.rb +93 -0
- data/lib/pubid/iso/identifiers/recommendation.rb +45 -0
- data/lib/pubid/iso/identifiers/supplement.rb +87 -0
- data/lib/pubid/iso/identifiers/tc_document.rb +108 -0
- data/lib/pubid/iso/identifiers/technical_report.rb +103 -0
- data/lib/pubid/iso/identifiers/technical_specification.rb +102 -0
- data/lib/pubid/iso/identifiers/technology_trends_assessments.rb +95 -0
- data/lib/pubid/iso/identifiers.rb +33 -0
- data/lib/pubid/iso/parser.rb +512 -0
- data/lib/pubid/iso/rendering_style.rb +120 -0
- data/lib/pubid/iso/scheme.rb +193 -0
- data/lib/pubid/iso/single_identifier.rb +64 -0
- data/lib/pubid/iso/supplement_identifier.rb +27 -0
- data/lib/pubid/iso/urn_generator.rb +426 -0
- data/lib/pubid/iso/urn_parser.rb +437 -0
- data/lib/pubid/iso/utilities.rb +86 -0
- data/lib/pubid/iso.rb +50 -0
- data/lib/pubid/itu/builder.rb +171 -0
- data/lib/pubid/itu/components/code.rb +39 -0
- data/lib/pubid/itu/components/sector.rb +35 -0
- data/lib/pubid/itu/components/series.rb +29 -0
- data/lib/pubid/itu/i18n.rb +9 -0
- data/lib/pubid/itu/i18n.yaml +30 -0
- data/lib/pubid/itu/identifier.rb +118 -0
- data/lib/pubid/itu/identifiers/amendment.rb +43 -0
- data/lib/pubid/itu/identifiers/annex.rb +74 -0
- data/lib/pubid/itu/identifiers/base.rb +154 -0
- data/lib/pubid/itu/identifiers/combined_identifier.rb +47 -0
- data/lib/pubid/itu/identifiers/corrigendum.rb +44 -0
- data/lib/pubid/itu/identifiers/recommendation.rb +16 -0
- data/lib/pubid/itu/identifiers/special_publication.rb +31 -0
- data/lib/pubid/itu/identifiers/supplement.rb +46 -0
- data/lib/pubid/itu/identifiers.rb +16 -0
- data/lib/pubid/itu/model.rb +111 -0
- data/lib/pubid/itu/parser.rb +225 -0
- data/lib/pubid/itu/scheme.rb +174 -0
- data/lib/pubid/itu/urn_generator.rb +105 -0
- data/lib/pubid/itu.rb +22 -0
- data/lib/pubid/jcgm/builder.rb +88 -0
- data/lib/pubid/jcgm/components/publisher.rb +20 -0
- data/lib/pubid/jcgm/components.rb +9 -0
- data/lib/pubid/jcgm/identifier.rb +54 -0
- data/lib/pubid/jcgm/identifiers/amendment.rb +35 -0
- data/lib/pubid/jcgm/identifiers/guide.rb +21 -0
- data/lib/pubid/jcgm/identifiers/gum_guide.rb +51 -0
- data/lib/pubid/jcgm/identifiers.rb +11 -0
- data/lib/pubid/jcgm/parser.rb +84 -0
- data/lib/pubid/jcgm/scheme.rb +60 -0
- data/lib/pubid/jcgm/single_identifier.rb +48 -0
- data/lib/pubid/jcgm/supplement_identifier.rb +16 -0
- data/lib/pubid/jcgm/urn_generator.rb +110 -0
- data/lib/pubid/jcgm.rb +31 -0
- data/lib/pubid/jis/builder.rb +124 -0
- data/lib/pubid/jis/components/code.rb +59 -0
- data/lib/pubid/jis/components.rb +9 -0
- data/lib/pubid/jis/identifier.rb +61 -0
- data/lib/pubid/jis/identifiers/amendment.rb +16 -0
- data/lib/pubid/jis/identifiers/base.rb +72 -0
- data/lib/pubid/jis/identifiers/explanation.rb +22 -0
- data/lib/pubid/jis/identifiers/japanese_industrial_standard.rb +16 -0
- data/lib/pubid/jis/identifiers/standard.rb +27 -0
- data/lib/pubid/jis/identifiers/technical_report.rb +31 -0
- data/lib/pubid/jis/identifiers/technical_specification.rb +31 -0
- data/lib/pubid/jis/identifiers.rb +17 -0
- data/lib/pubid/jis/parser.rb +109 -0
- data/lib/pubid/jis/scheme.rb +49 -0
- data/lib/pubid/jis/single_identifier.rb +37 -0
- data/lib/pubid/jis/supplement_identifier.rb +47 -0
- data/lib/pubid/jis/urn_generator.rb +25 -0
- data/lib/pubid/jis.rb +23 -0
- data/lib/pubid/lutaml/no_store_registration.rb +30 -0
- data/lib/pubid/nist/builder.rb +2269 -0
- data/lib/pubid/nist/components/code.rb +38 -0
- data/lib/pubid/nist/components/edition.rb +134 -0
- data/lib/pubid/nist/components/issue_number.rb +28 -0
- data/lib/pubid/nist/components/part.rb +77 -0
- data/lib/pubid/nist/components/publisher.rb +24 -0
- data/lib/pubid/nist/components/stage.rb +53 -0
- data/lib/pubid/nist/components/supplement.rb +188 -0
- data/lib/pubid/nist/components/translation.rb +42 -0
- data/lib/pubid/nist/components/update.rb +103 -0
- data/lib/pubid/nist/components/version.rb +35 -0
- data/lib/pubid/nist/components/volume.rb +32 -0
- data/lib/pubid/nist/components.rb +19 -0
- data/lib/pubid/nist/configuration.rb +77 -0
- data/lib/pubid/nist/identifier.rb +62 -0
- data/lib/pubid/nist/identifiers/base.rb +578 -0
- data/lib/pubid/nist/identifiers/circular.rb +68 -0
- data/lib/pubid/nist/identifiers/circular_supplement.rb +50 -0
- data/lib/pubid/nist/identifiers/commercial_standard.rb +41 -0
- data/lib/pubid/nist/identifiers/commercial_standard_emergency.rb +56 -0
- data/lib/pubid/nist/identifiers/commercial_standards_monthly.rb +56 -0
- data/lib/pubid/nist/identifiers/crpl_report.rb +132 -0
- data/lib/pubid/nist/identifiers/federal_information_processing_standards.rb +104 -0
- data/lib/pubid/nist/identifiers/grant_contractor_report.rb +35 -0
- data/lib/pubid/nist/identifiers/handbook.rb +50 -0
- data/lib/pubid/nist/identifiers/internal_report.rb +56 -0
- data/lib/pubid/nist/identifiers/letter_circular.rb +45 -0
- data/lib/pubid/nist/identifiers/miscellaneous_publication.rb +65 -0
- data/lib/pubid/nist/identifiers/monograph.rb +69 -0
- data/lib/pubid/nist/identifiers/ncstar.rb +41 -0
- data/lib/pubid/nist/identifiers/nsrds.rb +41 -0
- data/lib/pubid/nist/identifiers/owmwp.rb +35 -0
- data/lib/pubid/nist/identifiers/report.rb +67 -0
- data/lib/pubid/nist/identifiers/special_publication.rb +36 -0
- data/lib/pubid/nist/identifiers/technical_note.rb +90 -0
- data/lib/pubid/nist/identifiers.rb +33 -0
- data/lib/pubid/nist/parser.rb +1117 -0
- data/lib/pubid/nist/scheme.rb +199 -0
- data/lib/pubid/nist/supplement_identifier.rb +67 -0
- data/lib/pubid/nist/urn_generator.rb +133 -0
- data/lib/pubid/nist.rb +37 -0
- data/lib/pubid/oiml/builder.rb +189 -0
- data/lib/pubid/oiml/components/code.rb +20 -0
- data/lib/pubid/oiml/components.rb +9 -0
- data/lib/pubid/oiml/identifier.rb +61 -0
- data/lib/pubid/oiml/identifiers/amendment.rb +13 -0
- data/lib/pubid/oiml/identifiers/annex.rb +62 -0
- data/lib/pubid/oiml/identifiers/base.rb +36 -0
- data/lib/pubid/oiml/identifiers/basic_publication.rb +13 -0
- data/lib/pubid/oiml/identifiers/document.rb +13 -0
- data/lib/pubid/oiml/identifiers/expert_report.rb +13 -0
- data/lib/pubid/oiml/identifiers/guide.rb +13 -0
- data/lib/pubid/oiml/identifiers/recommendation.rb +13 -0
- data/lib/pubid/oiml/identifiers/seminar_report.rb +13 -0
- data/lib/pubid/oiml/identifiers/vocabulary.rb +13 -0
- data/lib/pubid/oiml/identifiers.rb +18 -0
- data/lib/pubid/oiml/parser.rb +173 -0
- data/lib/pubid/oiml/scheme.rb +46 -0
- data/lib/pubid/oiml/single_identifier.rb +90 -0
- data/lib/pubid/oiml/supplement_identifier.rb +43 -0
- data/lib/pubid/oiml/urn_generator.rb +64 -0
- data/lib/pubid/oiml.rb +26 -0
- data/lib/pubid/parser/common_parse_methods.rb +13 -0
- data/lib/pubid/parser/common_parse_rules.rb +56 -0
- data/lib/pubid/parser.rb +8 -0
- data/lib/pubid/parsers/base.rb +11 -0
- data/lib/pubid/parsers/mr_string.rb +93 -0
- data/lib/pubid/plateau/builder.rb +50 -0
- data/lib/pubid/plateau/identifier.rb +57 -0
- data/lib/pubid/plateau/identifiers/annex.rb +16 -0
- data/lib/pubid/plateau/identifiers/base.rb +51 -0
- data/lib/pubid/plateau/identifiers/handbook.rb +34 -0
- data/lib/pubid/plateau/identifiers/technical_report.rb +20 -0
- data/lib/pubid/plateau/identifiers.rb +12 -0
- data/lib/pubid/plateau/parser.rb +63 -0
- data/lib/pubid/plateau/scheme.rb +45 -0
- data/lib/pubid/plateau/supplement_identifier.rb +72 -0
- data/lib/pubid/plateau/urn_generator.rb +29 -0
- data/lib/pubid/plateau.rb +26 -0
- data/lib/pubid/renderers/base.rb +53 -0
- data/lib/pubid/renderers/directives_renderer.rb +61 -0
- data/lib/pubid/renderers/guide_renderer.rb +24 -0
- data/lib/pubid/renderers/human_readable.rb +70 -0
- data/lib/pubid/renderers/iwa_renderer.rb +20 -0
- data/lib/pubid/renderers/mr_string.rb +16 -0
- data/lib/pubid/renderers/supplement_renderer.rb +36 -0
- data/lib/pubid/renderers/urn.rb +11 -0
- data/lib/pubid/renderers.rb +14 -0
- data/lib/pubid/rendering/base.rb +73 -0
- data/lib/pubid/rendering/common.rb +211 -0
- data/lib/pubid/rendering/context.rb +159 -0
- data/lib/pubid/rendering/date.rb +27 -0
- data/lib/pubid/rendering/format.rb +25 -0
- data/lib/pubid/rendering/language.rb +21 -0
- data/lib/pubid/rendering/numbering.rb +24 -0
- data/lib/pubid/rendering/publisher.rb +25 -0
- data/lib/pubid/rendering/stage.rb +38 -0
- data/lib/pubid/rendering/supplement.rb +46 -0
- data/lib/pubid/rendering.rb +16 -0
- data/lib/pubid/sae/builder.rb +32 -0
- data/lib/pubid/sae/components/code.rb +9 -0
- data/lib/pubid/sae/components/date.rb +19 -0
- data/lib/pubid/sae/components/type.rb +19 -0
- data/lib/pubid/sae/components.rb +11 -0
- data/lib/pubid/sae/identifier.rb +37 -0
- data/lib/pubid/sae/identifiers/base.rb +42 -0
- data/lib/pubid/sae/identifiers.rb +9 -0
- data/lib/pubid/sae/parser.rb +55 -0
- data/lib/pubid/sae/scheme.rb +47 -0
- data/lib/pubid/sae/urn_generator.rb +38 -0
- data/lib/pubid/sae.rb +19 -0
- data/lib/pubid/scheme.rb +219 -0
- data/lib/pubid/urn_generator/base.rb +110 -0
- data/lib/pubid/utils/string_normalizer.rb +196 -0
- data/lib/pubid/utils.rb +7 -0
- data/lib/pubid/version.rb +3 -1
- data/lib/pubid.rb +137 -13
- data/lib/tasks/docs.rake +37 -0
- data/lib/tasks/export.rake +38 -0
- data/lib/tasks/website-data.json +7488 -0
- metadata +616 -171
- data/lib/pubid/registry.rb +0 -30
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "lutaml/model"
|
|
4
|
+
|
|
5
|
+
module Pubid
|
|
6
|
+
module Cie
|
|
7
|
+
module Identifiers
|
|
8
|
+
# Dual published identifier for CIE
|
|
9
|
+
# Represents CIE/IEC dual published standards
|
|
10
|
+
# Example: CIE S 009:2002/IEC 62471:2006
|
|
11
|
+
class DualPublished < SingleIdentifier
|
|
12
|
+
attribute :s_prefix, :boolean, default: -> { false }
|
|
13
|
+
attribute :code, Components::Code
|
|
14
|
+
attribute :iec_identifier, :string # IEC portion as string
|
|
15
|
+
|
|
16
|
+
def to_s
|
|
17
|
+
parts = ["CIE"]
|
|
18
|
+
|
|
19
|
+
# S prefix
|
|
20
|
+
parts << "S" if s_prefix
|
|
21
|
+
|
|
22
|
+
# Code
|
|
23
|
+
parts << code.to_s if code
|
|
24
|
+
|
|
25
|
+
result = parts.join(" ")
|
|
26
|
+
|
|
27
|
+
# Date
|
|
28
|
+
if year
|
|
29
|
+
separator = date_separator == "colon" ? ":" : "-"
|
|
30
|
+
result += "#{separator}#{year}"
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# IEC portion with slash separator
|
|
34
|
+
result += "/IEC #{iec_identifier}" if iec_identifier
|
|
35
|
+
|
|
36
|
+
result
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "lutaml/model"
|
|
4
|
+
|
|
5
|
+
module Pubid
|
|
6
|
+
module Cie
|
|
7
|
+
module Identifiers
|
|
8
|
+
# Identical identifier for CIE
|
|
9
|
+
# Represents CIE identifiers with ISO reference
|
|
10
|
+
# Examples:
|
|
11
|
+
# CIE S 006.1/1998 (ISO 16508:1999) - iteration with dot
|
|
12
|
+
# CIE S 014-4/E2007 - part with dash + language
|
|
13
|
+
# CIE S 008/E:2001 (ISO 8995-1:2002(E)) - language with colon year
|
|
14
|
+
class Identical < SingleIdentifier
|
|
15
|
+
attribute :s_prefix, :boolean, default: -> { false }
|
|
16
|
+
attribute :code, Components::Code
|
|
17
|
+
attribute :language, Components::Language
|
|
18
|
+
attribute :iso_reference, :string # The ISO identifier in parentheses
|
|
19
|
+
|
|
20
|
+
def to_s
|
|
21
|
+
parts = ["CIE"]
|
|
22
|
+
|
|
23
|
+
# S prefix
|
|
24
|
+
parts << "S" if s_prefix
|
|
25
|
+
|
|
26
|
+
# Code
|
|
27
|
+
parts << code.to_s if code
|
|
28
|
+
|
|
29
|
+
result = parts.join(" ")
|
|
30
|
+
|
|
31
|
+
# Language + Year combined for slash formats before ISO reference
|
|
32
|
+
if language && (language.format == "slash_colon" || (language.format == "slash" && year && date_separator != "slash"))
|
|
33
|
+
# Render /E:YYYY or /EYYYY (language with year, no separate date separator)
|
|
34
|
+
result += if language.format == "slash_colon"
|
|
35
|
+
"/#{language.code}:#{year}" # /E:2001
|
|
36
|
+
else
|
|
37
|
+
"/#{language.code}#{year}" # /E2007 (no colon)
|
|
38
|
+
end
|
|
39
|
+
elsif language && language.format == "slash"
|
|
40
|
+
# Language without year: /E
|
|
41
|
+
result += "/#{language.code}"
|
|
42
|
+
elsif year && date_separator == "slash"
|
|
43
|
+
# Legacy slash-year format without language: /1998
|
|
44
|
+
result += "/#{year}"
|
|
45
|
+
elsif year
|
|
46
|
+
# Standard date with separator (colon or dash)
|
|
47
|
+
separator = date_separator == "colon" ? ":" : "-"
|
|
48
|
+
result += "#{separator}#{year}"
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Language (parenthetical) after date
|
|
52
|
+
if language && language.format != "slash" && language.format != "slash_colon"
|
|
53
|
+
result += language.to_s
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# ISO reference in parentheses
|
|
57
|
+
result += " (ISO #{iso_reference})" if iso_reference
|
|
58
|
+
|
|
59
|
+
result
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "lutaml/model"
|
|
4
|
+
|
|
5
|
+
module Pubid
|
|
6
|
+
module Cie
|
|
7
|
+
module Identifiers
|
|
8
|
+
# Joint published identifier for CIE
|
|
9
|
+
# Handles CIE ISO, CIE IEC, CIE ISO/CIE patterns
|
|
10
|
+
class JointPublished < SingleIdentifier
|
|
11
|
+
attribute :copublisher, :string # "ISO", "IEC", or "ISO/CIE"
|
|
12
|
+
attribute :code, Components::Code
|
|
13
|
+
attribute :language, Components::Language
|
|
14
|
+
attribute :doc_type, :string # "TR" for Technical Report
|
|
15
|
+
attribute :stage, :string # "DIS" for draft stage
|
|
16
|
+
|
|
17
|
+
def to_s
|
|
18
|
+
parts = ["CIE", copublisher]
|
|
19
|
+
|
|
20
|
+
# Document type (TR)
|
|
21
|
+
parts << doc_type if doc_type
|
|
22
|
+
|
|
23
|
+
# Stage (DIS)
|
|
24
|
+
parts << stage if stage
|
|
25
|
+
|
|
26
|
+
# Code (number-part) - special handling for IEC dot separator
|
|
27
|
+
if code
|
|
28
|
+
code_str = code.to_s
|
|
29
|
+
# For IEC copublisher, if code has a part, use dot not slash/dash
|
|
30
|
+
if copublisher == "IEC" && code.part
|
|
31
|
+
code_str = "#{code.number}.#{code.part}"
|
|
32
|
+
end
|
|
33
|
+
parts << code_str
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
result = parts.join(" ")
|
|
37
|
+
|
|
38
|
+
# Date - use the actual captured separator
|
|
39
|
+
if year
|
|
40
|
+
separator = date_separator == "colon" ? ":" : "-"
|
|
41
|
+
result += "#{separator}#{year}"
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Language (always parenthetical for joint published)
|
|
45
|
+
result += language.to_s if language
|
|
46
|
+
|
|
47
|
+
result
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "lutaml/model"
|
|
4
|
+
|
|
5
|
+
module Pubid
|
|
6
|
+
module Cie
|
|
7
|
+
module Identifiers
|
|
8
|
+
# Standard identifier for CIE
|
|
9
|
+
# Handles both legacy (pre-2001) and current (2001+) styles
|
|
10
|
+
class Standard < SingleIdentifier
|
|
11
|
+
attribute :s_prefix, :boolean, default: -> { false }
|
|
12
|
+
attribute :code, Components::Code
|
|
13
|
+
attribute :language, Components::Language
|
|
14
|
+
attribute :stage, :string # DIS, DS
|
|
15
|
+
|
|
16
|
+
def to_s
|
|
17
|
+
parts = ["CIE"]
|
|
18
|
+
|
|
19
|
+
# Stage (DIS/DS) before code if present
|
|
20
|
+
parts << stage if stage
|
|
21
|
+
|
|
22
|
+
# S prefix
|
|
23
|
+
parts << "S" if s_prefix
|
|
24
|
+
|
|
25
|
+
# Code
|
|
26
|
+
parts << code.to_s if code
|
|
27
|
+
|
|
28
|
+
# Build initial result from parts
|
|
29
|
+
result = parts.join(" ")
|
|
30
|
+
|
|
31
|
+
# Language (slash format without year) - appended before date
|
|
32
|
+
if language && language.format == "slash"
|
|
33
|
+
result += "/#{language.code}"
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Language (slash_colon format with year) - language/colon/year as unit
|
|
37
|
+
if language && language.format == "slash_colon"
|
|
38
|
+
result += "/#{language.code}:#{year}"
|
|
39
|
+
return result # Year already added
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Date with separator (for non-slash-colon formats)
|
|
43
|
+
if year
|
|
44
|
+
separator = date_separator == "colon" ? ":" : "-"
|
|
45
|
+
result += "#{separator}#{year}"
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Language (parenthetical formats) - comes after date
|
|
49
|
+
if language && !["slash", "slash_colon"].include?(language.format)
|
|
50
|
+
result += language.to_s
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
result
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "lutaml/model"
|
|
4
|
+
|
|
5
|
+
module Pubid
|
|
6
|
+
module Cie
|
|
7
|
+
module Identifiers
|
|
8
|
+
# Supplement identifier for CIE
|
|
9
|
+
# Handles -SPN and -SPN.P notation with recursive base parsing
|
|
10
|
+
# Examples: CIE 121-SP1:2009, CIE 198-SP1.4:2011, CIE DIS 025-SP1/E:2019
|
|
11
|
+
class Supplement < SupplementIdentifier
|
|
12
|
+
attribute :base_number, :string
|
|
13
|
+
attribute :supplement_number, :string # "1", "2"
|
|
14
|
+
attribute :supplement_part, :string # "1" in "SP1.1", "4" in "SP1.4"
|
|
15
|
+
attribute :year, :string
|
|
16
|
+
attribute :stage, :string # "DIS", "DS"
|
|
17
|
+
attribute :language, Components::Language
|
|
18
|
+
|
|
19
|
+
def to_s
|
|
20
|
+
parts = ["CIE"]
|
|
21
|
+
|
|
22
|
+
# Stage if present (DIS/DS)
|
|
23
|
+
parts << stage if stage
|
|
24
|
+
|
|
25
|
+
# Build base number and supplement
|
|
26
|
+
result = parts.join(" ")
|
|
27
|
+
result += " #{base_number}-SP#{supplement_number}"
|
|
28
|
+
|
|
29
|
+
# Add part if present (e.g., ".4" in "SP1.4")
|
|
30
|
+
result += ".#{supplement_part}" if supplement_part
|
|
31
|
+
|
|
32
|
+
# Add language with slash if present (before year)
|
|
33
|
+
if language && language.format == "slash_colon"
|
|
34
|
+
result += "/#{language.code}"
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Add year with colon (supplements always use current style)
|
|
38
|
+
result += ":#{year}" if year
|
|
39
|
+
|
|
40
|
+
result
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "lutaml/model"
|
|
4
|
+
|
|
5
|
+
module Pubid
|
|
6
|
+
module Cie
|
|
7
|
+
module Identifiers
|
|
8
|
+
# Tutorial Bundle identifier for CIE
|
|
9
|
+
# Special text-based identifier
|
|
10
|
+
# Example: CIE Tutorials Bundle 1
|
|
11
|
+
class TutorialBundle < SingleIdentifier
|
|
12
|
+
attribute :bundle_number, :string
|
|
13
|
+
|
|
14
|
+
def to_s
|
|
15
|
+
"CIE Tutorials Bundle #{bundle_number}"
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pubid
|
|
4
|
+
module Cie
|
|
5
|
+
module Identifiers
|
|
6
|
+
autoload :Bundle, "#{__dir__}/identifiers/bundle"
|
|
7
|
+
autoload :Conference, "#{__dir__}/identifiers/conference"
|
|
8
|
+
autoload :Corrigendum, "#{__dir__}/identifiers/corrigendum"
|
|
9
|
+
autoload :DualPublished, "#{__dir__}/identifiers/dual_published"
|
|
10
|
+
autoload :Identical, "#{__dir__}/identifiers/identical"
|
|
11
|
+
autoload :JointPublished, "#{__dir__}/identifiers/joint_published"
|
|
12
|
+
autoload :Standard, "#{__dir__}/identifiers/standard"
|
|
13
|
+
autoload :Supplement, "#{__dir__}/identifiers/supplement"
|
|
14
|
+
autoload :TutorialBundle, "#{__dir__}/identifiers/tutorial_bundle"
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "parslet"
|
|
4
|
+
|
|
5
|
+
module Pubid
|
|
6
|
+
module Cie
|
|
7
|
+
# Parser for CIE identifiers
|
|
8
|
+
# Handles dual-style system (legacy vs current)
|
|
9
|
+
class Parser < Parslet::Parser
|
|
10
|
+
# Basic building blocks
|
|
11
|
+
rule(:space) { str(" ") }
|
|
12
|
+
rule(:space?) { space.maybe }
|
|
13
|
+
rule(:dash) { str("-") }
|
|
14
|
+
rule(:colon) { str(":") }
|
|
15
|
+
rule(:dot) { str(".") }
|
|
16
|
+
rule(:slash) { str("/") }
|
|
17
|
+
rule(:comma) { str(",") }
|
|
18
|
+
rule(:digit) { match("[0-9]") }
|
|
19
|
+
rule(:digits) { digit.repeat(1) }
|
|
20
|
+
rule(:upper) { match("[A-Z]") }
|
|
21
|
+
rule(:lower) { match("[a-z]") }
|
|
22
|
+
|
|
23
|
+
# Year (4 digits: 1900-2099)
|
|
24
|
+
rule(:year_digits) do
|
|
25
|
+
(str("19") | str("20")) >> digit.repeat(2, 2)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Date with separator detection (CRITICAL for style)
|
|
29
|
+
# Legacy: dash "-" (pre-2001)
|
|
30
|
+
# Current: colon ":" (2001+)
|
|
31
|
+
rule(:legacy_date) do
|
|
32
|
+
(dash >> year_digits.as(:year)).as(:legacy_date)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
rule(:current_date) do
|
|
36
|
+
(colon >> year_digits.as(:year)).as(:current_date)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
rule(:date) do
|
|
40
|
+
current_date | legacy_date
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Legacy format: NUMBER-YEAR (e.g., 001-1980)
|
|
44
|
+
# This is BEFORE 2001, using dash as year separator (NOT part)
|
|
45
|
+
# Can optionally have trailing language like "(RU-2020)"
|
|
46
|
+
rule(:legacy_code_with_year) do
|
|
47
|
+
str("CIE") >> space >> digits.as(:number) >> dash >> year_digits.as(:year) >>
|
|
48
|
+
(language_paren_year | str("")).as(:trailing_lang)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Code patterns
|
|
52
|
+
# Pattern 1: "006.1" - iteration (leading zero + dot)
|
|
53
|
+
rule(:code_with_iteration) do
|
|
54
|
+
digits.as(:number) >> dot >> digits.as(:iteration)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Pattern 1b: "19/2.1" - part with slash THEN iteration with dot (complex)
|
|
58
|
+
rule(:code_with_part_and_iteration_slash) do
|
|
59
|
+
digits.as(:number) >> slash >> digits.as(:part) >> dot >> digits.as(:iteration)
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Pattern 1c: "19-2.1" - part with dash THEN iteration with dot (complex)
|
|
63
|
+
rule(:code_with_part_and_iteration_dash) do
|
|
64
|
+
digits.as(:number) >> dash >> digits.as(:part) >> dot >> digits.as(:iteration) >>
|
|
65
|
+
dash.absent? # Don't consume date dash
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Pattern 2: "170-1" - part with dash (current style)
|
|
69
|
+
# NOTE: Part must be 1-3 digits, and NOT followed by a 4-digit year
|
|
70
|
+
rule(:code_with_part_dash) do
|
|
71
|
+
digits.as(:number) >> dash >> match("[0-9]").repeat(1, 3).as(:part) >>
|
|
72
|
+
str("").as(:dash_sep) >> # Marker for dash separator
|
|
73
|
+
# Negative lookahead: don't consume if followed by 4-digit year
|
|
74
|
+
(str("19") | str("20")).absent? >>
|
|
75
|
+
(dot | dash).absent? # Don't consume dot or date dash
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Pattern 3: "170/1" - part with slash (legacy style)
|
|
79
|
+
rule(:code_with_part_slash) do
|
|
80
|
+
digits.as(:number) >> slash >> digits.as(:part) >>
|
|
81
|
+
str("").as(:slash_sep) >> # Marker for slash separator
|
|
82
|
+
dot.absent? # Don't consume iteration dot
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Pattern 4: Simple number
|
|
86
|
+
rule(:code_simple) do
|
|
87
|
+
digits.as(:number)
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Code rule (longest match first - complex patterns before simple)
|
|
91
|
+
rule(:code) do
|
|
92
|
+
code_with_part_and_iteration_slash |
|
|
93
|
+
code_with_part_and_iteration_dash |
|
|
94
|
+
code_with_iteration |
|
|
95
|
+
code_with_part_slash |
|
|
96
|
+
code_with_part_dash |
|
|
97
|
+
code_simple
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Language patterns
|
|
101
|
+
# Format 1: /E, /F, /G (slash-prefix, legacy)
|
|
102
|
+
rule(:language_slash) do
|
|
103
|
+
(slash >> upper.as(:lang_code)).as(:language_slash)
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Format 2: (DE), (ES), (CN), (en), (E), (F), (G)
|
|
107
|
+
rule(:language_paren) do
|
|
108
|
+
(str("(") >> match("[A-Za-z]").repeat(1,
|
|
109
|
+
3).as(:lang_code) >> str(")")).as(:language_paren)
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# Format 3: (RU-2021) - with translation year
|
|
113
|
+
# NOTE: The space before parenthesis is OPTIONAL (e.g., "2003 (RU-2021)" or "2003(RU-2021)")
|
|
114
|
+
rule(:language_paren_year) do
|
|
115
|
+
(space.maybe >> str("(") >> upper.repeat(2).as(:lang_code) >>
|
|
116
|
+
dash >> year_digits.as(:trans_year) >> str(")")).as(:language_paren_year)
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
rule(:language) do
|
|
120
|
+
language_paren_year | language_paren | language_slash
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# S prefix (optional "Standard" marker)
|
|
124
|
+
rule(:s_prefix) do
|
|
125
|
+
str("S") >> space
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Conference x-prefix
|
|
129
|
+
rule(:x_prefix) do
|
|
130
|
+
str("x")
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# Stage codes (DIS, DS, FDIS, etc.)
|
|
134
|
+
rule(:stage_code) do
|
|
135
|
+
(str("FDIS") | str("DIS") | str("DS")) >> space
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# Document type (TR for Technical Report)
|
|
139
|
+
rule(:doc_type) do
|
|
140
|
+
str("TR") # Don't consume trailing space
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# DIS stage with supplement pattern (e.g., DIS 025-SP1/E:2019)
|
|
144
|
+
rule(:dis_with_supplement) do
|
|
145
|
+
str("CIE") >> space >>
|
|
146
|
+
stage_code.as(:stage) >>
|
|
147
|
+
s_prefix.maybe.as(:s_prefix) >>
|
|
148
|
+
digits.as(:base_number) >>
|
|
149
|
+
dash >> str("SP") >> digits.as(:supplement_number) >>
|
|
150
|
+
(dot >> digits.as(:supplement_part)).maybe >>
|
|
151
|
+
slash >> upper.as(:lang_code) >> colon.as(:lang_colon) >> year_digits.as(:year)
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# Standard identifier (most common) - language can come AFTER date
|
|
155
|
+
rule(:standard_identifier) do
|
|
156
|
+
str("CIE") >> space >>
|
|
157
|
+
stage_code.maybe.as(:stage) >>
|
|
158
|
+
s_prefix.maybe.as(:s_prefix) >>
|
|
159
|
+
code >>
|
|
160
|
+
# Language can come BEFORE date, AFTER date, or both
|
|
161
|
+
(
|
|
162
|
+
(language >> date).as(:lang_before) |
|
|
163
|
+
(date >> language.maybe).as(:date_then_lang) |
|
|
164
|
+
date
|
|
165
|
+
)
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
# Standard identifier without ISO reference but with language-year (CIE S 014-4/E:2007)
|
|
169
|
+
rule(:standard_with_language_year) do
|
|
170
|
+
str("CIE") >> space >>
|
|
171
|
+
stage_code.maybe.as(:stage) >>
|
|
172
|
+
s_prefix.maybe.as(:s_prefix) >>
|
|
173
|
+
code >>
|
|
174
|
+
slash >> upper.as(:lang_code) >> colon.as(:lang_colon) >> year_digits.as(:year)
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# Conference identifier (x-prefix)
|
|
178
|
+
rule(:conference_identifier) do
|
|
179
|
+
str("CIE") >> space >>
|
|
180
|
+
x_prefix.as(:conference) >>
|
|
181
|
+
digits.as(:conf_number) >>
|
|
182
|
+
date >>
|
|
183
|
+
# Optional amendment
|
|
184
|
+
(space >> str("Amendment") >> space >> digits.as(:amd_number)).maybe
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
# Joint published with ISO
|
|
188
|
+
rule(:joint_with_iso) do
|
|
189
|
+
str("CIE") >> space >>
|
|
190
|
+
str("ISO").as(:copublisher) >> # Match and mark once
|
|
191
|
+
(slash >> str("CIE")).absent? >> # Make sure it's not "ISO/CIE"
|
|
192
|
+
space >>
|
|
193
|
+
(doc_type >> space).maybe.as(:doc_type) >> # Consume space here
|
|
194
|
+
stage_code.maybe.as(:stage) >>
|
|
195
|
+
digits.as(:number) >>
|
|
196
|
+
(dash >> digits.as(:part)).maybe >>
|
|
197
|
+
((colon >> year_digits.as(:year)) | (dash >> year_digits.as(:year))).maybe >>
|
|
198
|
+
language.maybe
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
# Joint with ISO/CIE (special case)
|
|
202
|
+
rule(:joint_with_iso_cie) do
|
|
203
|
+
str("CIE") >> space >>
|
|
204
|
+
str("ISO/CIE").as(:copublisher) >> # Match and mark once
|
|
205
|
+
space >>
|
|
206
|
+
(doc_type >> space).maybe.as(:doc_type) >> # Consume space here
|
|
207
|
+
digits.as(:number) >>
|
|
208
|
+
(colon >> year_digits.as(:year)).maybe >>
|
|
209
|
+
language.maybe
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
# Joint published with IEC
|
|
213
|
+
rule(:joint_with_iec) do
|
|
214
|
+
str("CIE") >> space >>
|
|
215
|
+
str("IEC").as(:copublisher) >> # Match and mark once
|
|
216
|
+
space >>
|
|
217
|
+
digits.as(:number) >>
|
|
218
|
+
dot >> digits.as(:part) >> # IEC always uses dot
|
|
219
|
+
dash >> year_digits.as(:year)
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
# Identical with ISO (parenthetical reference)
|
|
223
|
+
# Patterns:
|
|
224
|
+
# "CIE S 006.1/1998 (ISO 16508:1999)" - iteration with dot
|
|
225
|
+
# "CIE S 014-4/E2007" - part with dash + language without colon (needs colon insertion)
|
|
226
|
+
# "CIE S 008/E:2001 (ISO 8995-1:2002(E))" - language with colon year
|
|
227
|
+
rule(:identical_with_iso) do
|
|
228
|
+
str("CIE") >> space >>
|
|
229
|
+
s_prefix.maybe.as(:s_prefix) >>
|
|
230
|
+
digits.as(:number) >>
|
|
231
|
+
# Can have iteration (.1) OR part (-4)
|
|
232
|
+
(
|
|
233
|
+
(dot >> digits.as(:iteration)) |
|
|
234
|
+
(dash >> digits.as(:part))
|
|
235
|
+
).maybe >>
|
|
236
|
+
# Slash handling - three mutually exclusive patterns:
|
|
237
|
+
(slash >>
|
|
238
|
+
(
|
|
239
|
+
# /E:2001 - language code WITH colon year
|
|
240
|
+
(upper.as(:lang_code) >> colon.as(:lang_colon) >> year_digits.as(:year)) |
|
|
241
|
+
# /E2007 - language code WITHOUT colon + year (needs colon insertion)
|
|
242
|
+
(upper.as(:lang_code) >> year_digits.as(:year)) |
|
|
243
|
+
# /1998 - just legacy slash-year (no language)
|
|
244
|
+
year_digits.as(:slash_year)
|
|
245
|
+
)
|
|
246
|
+
).maybe >>
|
|
247
|
+
# ISO reference - handle nested parentheses for language codes
|
|
248
|
+
space >> str("(ISO") >> space >>
|
|
249
|
+
# Match ISO identifier: digits, colons, dashes, slashes, dots
|
|
250
|
+
# Plus optional language code in parentheses like (E), (F)
|
|
251
|
+
(
|
|
252
|
+
match("[0-9A-Z:/.\\-]").repeat(1) >> # Main ISO identifier
|
|
253
|
+
(str("(") >> match("[A-Z]").repeat(1) >> str(")")).maybe # Optional (E), (F), etc.
|
|
254
|
+
).as(:iso_reference) >>
|
|
255
|
+
str(")")
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
# Dual published with IEC (slash separator between full identifiers)
|
|
259
|
+
# Pattern: "CIE S 009:2002/IEC 62471:2006"
|
|
260
|
+
rule(:dual_with_iec) do
|
|
261
|
+
str("CIE") >> space >>
|
|
262
|
+
s_prefix.maybe.as(:s_prefix) >>
|
|
263
|
+
digits.as(:number) >>
|
|
264
|
+
colon >> year_digits.as(:year) >>
|
|
265
|
+
slash >> str("IEC") >> space >>
|
|
266
|
+
match("[^)\\n]").repeat(1).as(:iec_identifier)
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
# Supplement identifier (-SPN notation)
|
|
270
|
+
rule(:supplement_identifier) do
|
|
271
|
+
str("CIE") >> space >>
|
|
272
|
+
digits.as(:base_number) >>
|
|
273
|
+
dash >> str("SP") >> digits.as(:supplement_number) >>
|
|
274
|
+
(dot >> digits.as(:supplement_part)).maybe >>
|
|
275
|
+
colon >> year_digits.as(:year)
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
# Corrigendum identifier (/CorN notation)
|
|
279
|
+
rule(:corrigendum_identifier) do
|
|
280
|
+
# Parse base identifier first (could be supplement or standard)
|
|
281
|
+
str("CIE") >> space >>
|
|
282
|
+
digits.as(:base_number) >>
|
|
283
|
+
# Could have supplement notation before corrigendum
|
|
284
|
+
(dash >> str("SP") >> digits.as(:base_supplement) >>
|
|
285
|
+
(dot >> digits.as(:base_supplement_part)).maybe).maybe >>
|
|
286
|
+
colon >> year_digits.as(:base_year) >>
|
|
287
|
+
# Corrigendum portion
|
|
288
|
+
slash >> str("Cor") >> digits.as(:cor_number) >>
|
|
289
|
+
colon >> year_digits.as(:cor_year)
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
# Bundle identifier (comma-separated list)
|
|
293
|
+
rule(:bundle_identifier) do
|
|
294
|
+
str("CIE") >> space >>
|
|
295
|
+
digits.as(:first_number) >>
|
|
296
|
+
dash >> str("SP") >> digits >> dot >> digits >>
|
|
297
|
+
colon >> year_digits >>
|
|
298
|
+
(comma >> digits.as(:next_number) >>
|
|
299
|
+
dash >> str("SP") >> digits >> dot >> digits >>
|
|
300
|
+
colon >> year_digits).repeat(1).as(:bundle_items)
|
|
301
|
+
end
|
|
302
|
+
|
|
303
|
+
# Tutorial Bundle
|
|
304
|
+
rule(:tutorial_bundle) do
|
|
305
|
+
str("CIE Tutorials Bundle") >> space >> digits.as(:bundle_number)
|
|
306
|
+
end
|
|
307
|
+
|
|
308
|
+
# Main identifier rule (longest/most specific first)
|
|
309
|
+
root(:identifier)
|
|
310
|
+
|
|
311
|
+
rule(:identifier) do
|
|
312
|
+
tutorial_bundle |
|
|
313
|
+
bundle_identifier |
|
|
314
|
+
joint_with_iso_cie |
|
|
315
|
+
joint_with_iso |
|
|
316
|
+
joint_with_iec |
|
|
317
|
+
identical_with_iso |
|
|
318
|
+
dis_with_supplement |
|
|
319
|
+
dual_with_iec |
|
|
320
|
+
corrigendum_identifier |
|
|
321
|
+
supplement_identifier |
|
|
322
|
+
standard_with_language_year |
|
|
323
|
+
legacy_code_with_year | # Before standard to catch 001-1980 pattern
|
|
324
|
+
conference_identifier |
|
|
325
|
+
standard_identifier
|
|
326
|
+
end
|
|
327
|
+
|
|
328
|
+
# Class method for parsing with preprocessing
|
|
329
|
+
def self.parse(string)
|
|
330
|
+
# Minimal preprocessing for data quality
|
|
331
|
+
cleaned = string.strip
|
|
332
|
+
|
|
333
|
+
# Remove comments (text after #)
|
|
334
|
+
cleaned = cleaned.gsub(/\s*#.*$/, "")
|
|
335
|
+
|
|
336
|
+
# Normalize spaces
|
|
337
|
+
cleaned = cleaned.gsub(/\s+/, " ")
|
|
338
|
+
|
|
339
|
+
# Insert missing colon before year in language patterns like /E2007 -> /E:2007
|
|
340
|
+
# This is a data quality fix - correct format always has colon
|
|
341
|
+
cleaned = cleaned.gsub(%r{/(E|F|G|DE|ES|CN|RU|FR)(\d{4})}, '/\1:\2')
|
|
342
|
+
|
|
343
|
+
new.parse(cleaned)
|
|
344
|
+
end
|
|
345
|
+
end
|
|
346
|
+
end
|
|
347
|
+
end
|