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 +4 -4
- data/grammars/basicdoc.rng +18 -2
- data/grammars/biblio.rng +1 -0
- data/lib/relaton_itu/data_parser_r.rb +5 -1
- data/lib/relaton_itu/document_type.rb +21 -0
- data/lib/relaton_itu/hash_converter.rb +28 -23
- data/lib/relaton_itu/itu_bibliographic_item.rb +3 -13
- data/lib/relaton_itu/scrapper.rb +1 -1
- data/lib/relaton_itu/version.rb +1 -1
- data/lib/relaton_itu.rb +1 -0
- data/relaton-itu.gemspec +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3fe7b62f593b31cdf9a2441ecafb931c0e53d3aff3bc0abc089f4b8227dc00bc
|
4
|
+
data.tar.gz: e727a837e88114c9d80d4d606551721f45dcb0de32df74826fd765b2616c3802
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f92d14d1e7b0e019360a1c988abcbaedaf24dc4186e48f6b7308dd605777581ec16c5a5188b0e24ffd1a18f48341b7bfe70440a08b0d01ab0dde245c8a18d32
|
7
|
+
data.tar.gz: 4d075c9d458e88e02741fc017d99e930d516ee5810aa374c08519e2a1964d3c1b20b9156bf11a643318408efe20f080daea7976317467ab809bd2f1de0e58031
|
data/grammars/basicdoc.rng
CHANGED
@@ -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
|
-
<
|
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
|
-
<
|
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
@@ -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
|
-
|
3
|
-
|
4
|
-
|
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
|
-
|
16
|
-
|
17
|
-
|
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
|
-
|
20
|
-
|
21
|
+
ret[:editorialgroup] = EditorialGroup.new(**eg)
|
22
|
+
end
|
21
23
|
|
22
|
-
|
23
|
-
|
24
|
-
|
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
|
-
|
27
|
-
|
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
|
-
|
13
|
-
|
14
|
-
end
|
15
|
-
super
|
16
|
-
end
|
4
|
+
# def initialize(**args)
|
5
|
+
# super
|
6
|
+
# end
|
17
7
|
|
18
8
|
#
|
19
9
|
# Fetch flavor schema version
|
data/lib/relaton_itu/scrapper.rb
CHANGED
data/lib/relaton_itu/version.rb
CHANGED
data/lib/relaton_itu.rb
CHANGED
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.
|
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.
|
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-
|
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.
|
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.
|
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
|