relaton-itu 1.16.2 → 1.17.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 443de281f4001442162f16fb86986ab597616e3ae2981a44efe8ae9fccaa0a2b
4
- data.tar.gz: 4389f4b0d42563047b6bb7cd927b95872f0ec0a18a5ef377e900df1f2646b473
3
+ metadata.gz: 3fe7b62f593b31cdf9a2441ecafb931c0e53d3aff3bc0abc089f4b8227dc00bc
4
+ data.tar.gz: e727a837e88114c9d80d4d606551721f45dcb0de32df74826fd765b2616c3802
5
5
  SHA512:
6
- metadata.gz: bac3b34ee7dd29bb81d34e684e10310c0d4496745e610fce3bc20668b8ae17ec85171823b9b48d8709137086d7d2171edbf702bc16b7b0956506a95b6273a60a
7
- data.tar.gz: 52e8ddec0d293ab9dbe4f0c1ece20562aaf2ea838bca96f3ec423d16117be291251f4cc7b655117fa3edd18e341ecc38559b79e46b8903ac6c1f781c7eefd89b
6
+ metadata.gz: 5f92d14d1e7b0e019360a1c988abcbaedaf24dc4186e48f6b7308dd605777581ec16c5a5188b0e24ffd1a18f48341b7bfe70440a08b0d01ab0dde245c8a18d32
7
+ data.tar.gz: 4d075c9d458e88e02741fc017d99e930d516ee5810aa374c08519e2a1964d3c1b20b9156bf11a643318408efe20f080daea7976317467ab809bd2f1de0e58031
@@ -346,6 +346,8 @@
346
346
  <ref name="keyword"/>
347
347
  <ref name="xref"/>
348
348
  <ref name="hyperlink"/>
349
+ <ref name="index"/>
350
+ <ref name="index-xref"/>
349
351
  </choice>
350
352
  </oneOrMore>
351
353
  </element>
@@ -623,6 +625,8 @@
623
625
  <ref name="eref"/>
624
626
  <ref name="xref"/>
625
627
  <ref name="hyperlink"/>
628
+ <ref name="index"/>
629
+ <ref name="index-xref"/>
626
630
  </choice>
627
631
  </zeroOrMore>
628
632
  </element>
@@ -636,6 +640,8 @@
636
640
  <ref name="eref"/>
637
641
  <ref name="xref"/>
638
642
  <ref name="hyperlink"/>
643
+ <ref name="index"/>
644
+ <ref name="index-xref"/>
639
645
  </choice>
640
646
  </zeroOrMore>
641
647
  </element>
@@ -648,6 +654,8 @@
648
654
  <ref name="eref"/>
649
655
  <ref name="xref"/>
650
656
  <ref name="hyperlink"/>
657
+ <ref name="index"/>
658
+ <ref name="index-xref"/>
651
659
  </choice>
652
660
  </zeroOrMore>
653
661
  </element>
@@ -655,7 +663,11 @@
655
663
  <define name="keyword">
656
664
  <element name="keyword">
657
665
  <zeroOrMore>
658
- <ref name="PureTextElement"/>
666
+ <choice>
667
+ <ref name="PureTextElement"/>
668
+ <ref name="index"/>
669
+ <ref name="index-xref"/>
670
+ </choice>
659
671
  </zeroOrMore>
660
672
  </element>
661
673
  </define>
@@ -676,7 +688,11 @@
676
688
  <define name="strike">
677
689
  <element name="strike">
678
690
  <zeroOrMore>
679
- <ref name="PureTextElement"/>
691
+ <choice>
692
+ <ref name="PureTextElement"/>
693
+ <ref name="index"/>
694
+ <ref name="index-xref"/>
695
+ </choice>
680
696
  </zeroOrMore>
681
697
  </element>
682
698
  </define>
data/grammars/biblio.rng CHANGED
@@ -942,6 +942,7 @@
942
942
  <value>obsoleted</value>
943
943
  <value>confirmed</value>
944
944
  <value>updated</value>
945
+ <value>corrected</value>
945
946
  <value>issued</value>
946
947
  <value>transmitted</value>
947
948
  <value>copied</value>
@@ -16,7 +16,7 @@ module RelatonItu
16
16
  docid: fetch_docid(doc), title: fetch_title(doc),
17
17
  abstract: fetch_abstract(doc), date: fetch_date(doc), language: ["en"],
18
18
  link: fetch_link(url), script: ["Latn"], docstatus: fetch_status(doc),
19
- type: "standard", doctype: type
19
+ type: "standard", doctype: fetch_doctype(type)
20
20
  )
21
21
  end
22
22
 
@@ -90,5 +90,9 @@ module RelatonItu
90
90
 
91
91
  RelatonBib::DocumentStatus.new stage: s.text
92
92
  end
93
+
94
+ def fetch_doctype(type)
95
+ DocumentType.new(type: type)
96
+ end
93
97
  end
94
98
  end
@@ -0,0 +1,21 @@
1
+ module RelatonItu
2
+ class DocumentType < RelatonBib::DocumentType
3
+ TYPES = %w[
4
+ recommendation recommendation-supplement recommendation-amendment
5
+ recommendation-corrigendum recommendation-errata recommendation-annex
6
+ focus-group implementers-guide technical-paper technical-report
7
+ joint-itu-iso-iec resolution service-publication handbook question
8
+ ].freeze
9
+
10
+ def initialize(type:, abbreviation: nil)
11
+ check_type type
12
+ super
13
+ end
14
+
15
+ def check_type(type)
16
+ unless TYPES.include? type
17
+ Util.warn "WARNING: Invalid doctype: `#{type}`"
18
+ end
19
+ end
20
+ end
21
+ end
@@ -1,32 +1,37 @@
1
1
  module RelatonItu
2
- class HashConverter < RelatonBib::HashConverter
3
- class << self
4
- private
2
+ module HashConverter
3
+ include RelatonBib::HashConverter
4
+ extend self
5
5
 
6
- #
7
- # Ovverides superclass's method
8
- #
9
- # @param item [Hash]
10
- # @retirn [RelatonItu::ItuBibliographicItem]
11
- def bib_item(item)
12
- ItuBibliographicItem.new(**item)
13
- end
6
+ private
14
7
 
15
- def editorialgroup_hash_to_bib(ret)
16
- eg = ret[:editorialgroup]
17
- return unless eg
8
+ #
9
+ # Ovverides superclass's method
10
+ #
11
+ # @param item [Hash]
12
+ # @retirn [RelatonItu::ItuBibliographicItem]
13
+ def bib_item(item)
14
+ ItuBibliographicItem.new(**item)
15
+ end
16
+
17
+ def editorialgroup_hash_to_bib(ret)
18
+ eg = ret[:editorialgroup]
19
+ return unless eg
18
20
 
19
- ret[:editorialgroup] = EditorialGroup.new **eg
20
- end
21
+ ret[:editorialgroup] = EditorialGroup.new(**eg)
22
+ end
21
23
 
22
- # @param ret [Hash]
23
- def structuredidentifier_hash_to_bib(ret)
24
- return unless ret[:structuredidentifier]
24
+ # @param ret [Hash]
25
+ def structuredidentifier_hash_to_bib(ret)
26
+ return unless ret[:structuredidentifier]
27
+
28
+ ret[:structuredidentifier] = StructuredIdentifier.new(
29
+ **ret[:structuredidentifier]
30
+ )
31
+ end
25
32
 
26
- ret[:structuredidentifier] = StructuredIdentifier.new(
27
- **ret[:structuredidentifier]
28
- )
29
- end
33
+ def create_doctype(**args)
34
+ DocumentType.new(**args)
30
35
  end
31
36
  end
32
37
  end
@@ -1,19 +1,9 @@
1
1
  module RelatonItu
2
2
  class ItuBibliographicItem < RelatonBib::BibliographicItem
3
- TYPES = %w[
4
- recommendation recommendation-supplement recommendation-amendment
5
- recommendation-corrigendum recommendation-errata recommendation-annex
6
- focus-group implementers-guide technical-paper technical-report
7
- joint-itu-iso-iec resolution service-publication handbook question
8
- ].freeze
9
-
10
3
  # @params structuredidentifier [RelatonItu::StructuredIdentifier]
11
- def initialize(**args)
12
- if args[:doctype] && !TYPES.include?(args[:doctype])
13
- Util.warn "WARNING: Invalid doctype: `#{args[:doctype]}`"
14
- end
15
- super
16
- end
4
+ # def initialize(**args)
5
+ # super
6
+ # end
17
7
 
18
8
  #
19
9
  # Fetch flavor schema version
@@ -49,7 +49,7 @@ module RelatonItu
49
49
  language: ["en"],
50
50
  script: ["Latn"],
51
51
  title: fetch_titles(doc),
52
- doctype: hit.hit[:type],
52
+ doctype: DocumentType.new(type: hit.hit[:type]),
53
53
  docstatus: fetch_status(doc),
54
54
  ics: [], # fetch_ics(doc),
55
55
  date: fetch_dates(doc),
@@ -1,3 +1,3 @@
1
1
  module RelatonItu
2
- VERSION = "1.16.2".freeze
2
+ VERSION = "1.17.0".freeze
3
3
  end
data/lib/relaton_itu.rb CHANGED
@@ -6,6 +6,7 @@ require "relaton_bib"
6
6
  require "relaton_itu/version"
7
7
  require "relaton_itu/config"
8
8
  require "relaton_itu/util"
9
+ require "relaton_itu/document_type"
9
10
  require "relaton_itu/pubid"
10
11
  require "relaton_itu/itu_bibliography"
11
12
  require "relaton_itu/data_fetcher"
data/relaton-itu.gemspec CHANGED
@@ -27,6 +27,6 @@ Gem::Specification.new do |spec|
27
27
 
28
28
  spec.add_dependency "mechanize", "~> 2.8.0"
29
29
  spec.add_dependency "parslet", "~> 2.0.0"
30
- spec.add_dependency "relaton-bib", "~> 1.16.0"
30
+ spec.add_dependency "relaton-bib", "~> 1.17.0"
31
31
  spec.add_dependency "relaton-index", "~> 0.2.0"
32
32
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-itu
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.16.2
4
+ version: 1.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-10-15 00:00:00.000000000 Z
11
+ date: 2023-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mechanize
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 1.16.0
47
+ version: 1.17.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 1.16.0
54
+ version: 1.17.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: relaton-index
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -95,6 +95,7 @@ files:
95
95
  - lib/relaton_itu/config.rb
96
96
  - lib/relaton_itu/data_fetcher.rb
97
97
  - lib/relaton_itu/data_parser_r.rb
98
+ - lib/relaton_itu/document_type.rb
98
99
  - lib/relaton_itu/editorial_group.rb
99
100
  - lib/relaton_itu/hash_converter.rb
100
101
  - lib/relaton_itu/hit.rb