relaton-jis 1.16.8 → 1.18.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: e113cd5725a3c5171dc809f77224245704ee4c7427acadbc999d48ca157ffe87
4
- data.tar.gz: 853ac93542cff181c4884d7f7274b2a228ba0d134605b109ee156d86ff171208
3
+ metadata.gz: f81af6fcda0f11448a44416410a1887385d86893047a3b26c59168f0b702d10b
4
+ data.tar.gz: 458f566abf32ca8c7a4ec52dcdfff9199d2b5e1aea0613bd824fbeca7ab1414a
5
5
  SHA512:
6
- metadata.gz: 4ec7a469729e0c12adb7d7a7373b3d8d98aa447ac3f59471df09b40725c52745b57b479ecc4afe26e4b6b042bada2169bea6fc1bd3347581f5f0af94b822fb3e
7
- data.tar.gz: 562a23c32ad963f335724d91a0dabe97f4c8ee8a0a1cae77544c8ec6aa4310eaa4c27ac4c28fda9fa5306df702d9fa5c45fe90ba494b1682a70a2e322d5d7be1
6
+ metadata.gz: 06c67dc4e2e2fda9135fe8ac68c8011e741c7739a7ddafad9367474a1e9fd87e5537412c3a180684f4d379c12e49edf7a7bd98ae55a51c445fb5d3ab7fca546d
7
+ data.tar.gz: 91fbc089e677f58cad13e93d0a1351518f4caabd7b36cf1266f792fbe93e062522f8d313612597301eb0de2366de1ad0623030754be326c31449f57ce04dd442
data/README.adoc CHANGED
@@ -112,7 +112,7 @@ Possible options:
112
112
  [source,ruby]
113
113
  ----
114
114
  item.to_xml
115
- => "<bibitem id="JISX0208-1997" type="standard" schema-version="v1.2.5">
115
+ => "<bibitem id="JISX0208-1997" type="standard" schema-version="v1.2.8">
116
116
  <fetched>2023-03-18</fetched>
117
117
  <title format="text/plain" language="ja" script="Jpan">7ビット及び8ビットの2バイト情報交換用符号化漢字集合</title>
118
118
  <title format="text/plain" language="en" script="Lant">7-bit and 8-bit double byte coded KANJI sets for information interchange</title>
@@ -120,7 +120,7 @@ item.to_xml
120
120
  </bibitem>"
121
121
 
122
122
  item.to_xml bibdata: true
123
- => "<bibdata type="standard" schema-version="v1.2.5">
123
+ => "<bibdata type="standard" schema-version="v1.2.8">
124
124
  <fetched>2023-03-18</fetched>
125
125
  <title format="text/plain" language="ja" script="Jpan">7ビット及び8ビットの2バイト情報交換用符号化漢字集合</title>
126
126
  <title format="text/plain" language="en" script="Lant">7-bit and 8-bit double byte coded KANJI sets for information interchange</title>
@@ -95,8 +95,89 @@
95
95
  <ref name="pagebreak"/>
96
96
  <ref name="hr"/>
97
97
  <ref name="bookmark"/>
98
+ <ref name="amend"/>
98
99
  </choice>
99
100
  </define>
101
+ <define name="amend">
102
+ <element name="amend">
103
+ <ref name="AmendType"/>
104
+ </element>
105
+ </define>
106
+ <define name="AmendType">
107
+ <optional>
108
+ <attribute name="id">
109
+ <data type="ID"/>
110
+ </attribute>
111
+ </optional>
112
+ <attribute name="change">
113
+ <choice>
114
+ <value>add</value>
115
+ <value>modify</value>
116
+ <value>delete</value>
117
+ <value>replace</value>
118
+ </choice>
119
+ </attribute>
120
+ <optional>
121
+ <attribute name="path"/>
122
+ </optional>
123
+ <optional>
124
+ <attribute name="path_end"/>
125
+ </optional>
126
+ <optional>
127
+ <attribute name="title"/>
128
+ </optional>
129
+ <optional>
130
+ <element name="location">
131
+ <zeroOrMore>
132
+ <choice>
133
+ <ref name="locality"/>
134
+ <ref name="localityStack"/>
135
+ </choice>
136
+ </zeroOrMore>
137
+ </element>
138
+ </optional>
139
+ <optional>
140
+ <element name="description">
141
+ <zeroOrMore>
142
+ <ref name="BasicBlock"/>
143
+ </zeroOrMore>
144
+ </element>
145
+ </optional>
146
+ <optional>
147
+ <element name="newcontent">
148
+ <optional>
149
+ <attribute name="id">
150
+ <data type="ID"/>
151
+ </attribute>
152
+ </optional>
153
+ <zeroOrMore>
154
+ <ref name="BasicBlock"/>
155
+ </zeroOrMore>
156
+ </element>
157
+ </optional>
158
+ <zeroOrMore>
159
+ <ref name="classification"/>
160
+ </zeroOrMore>
161
+ <zeroOrMore>
162
+ <ref name="contributor"/>
163
+ </zeroOrMore>
164
+ </define>
165
+ <define name="classification">
166
+ <element name="classification">
167
+ <ref name="classification_tag"/>
168
+ <ref name="classification_value"/>
169
+ </element>
170
+ </define>
171
+ <define name="classification_tag">
172
+ <element name="tag">
173
+ <text/>
174
+ </element>
175
+ </define>
176
+ <define name="classification_value">
177
+ <element name="value">
178
+ <text/>
179
+ </element>
180
+ </define>
100
181
  <define name="paragraph">
101
182
  <element name="p">
102
183
  <ref name="ParagraphType"/>
@@ -715,27 +796,36 @@
715
796
  </define>
716
797
  <define name="ruby">
717
798
  <element name="ruby">
718
- <zeroOrMore>
719
- <choice>
720
- <ref name="PureTextElement"/>
721
- <ref name="rp"/>
722
- <ref name="rt"/>
723
- </choice>
724
- </zeroOrMore>
799
+ <choice>
800
+ <ref name="ruby_pronunciation"/>
801
+ <ref name="ruby_annotation"/>
802
+ </choice>
803
+ <choice>
804
+ <text/>
805
+ <ref name="ruby"/>
806
+ </choice>
725
807
  </element>
726
808
  </define>
727
- <define name="rp">
728
- <element name="rp">
729
- <zeroOrMore>
730
- <ref name="PureTextElement"/>
731
- </zeroOrMore>
809
+ <define name="ruby_pronunciation">
810
+ <element name="pronunciation">
811
+ <attribute name="value"/>
812
+ <optional>
813
+ <attribute name="script"/>
814
+ </optional>
815
+ <optional>
816
+ <attribute name="lang"/>
817
+ </optional>
732
818
  </element>
733
819
  </define>
734
- <define name="rt">
735
- <element name="rt">
736
- <zeroOrMore>
737
- <ref name="PureTextElement"/>
738
- </zeroOrMore>
820
+ <define name="ruby_annotation">
821
+ <element name="annotation">
822
+ <attribute name="value"/>
823
+ <optional>
824
+ <attribute name="script"/>
825
+ </optional>
826
+ <optional>
827
+ <attribute name="lang"/>
828
+ </optional>
739
829
  </element>
740
830
  </define>
741
831
  <define name="br">
@@ -914,44 +1004,49 @@
914
1004
  -->
915
1005
  <define name="image">
916
1006
  <element name="image">
917
- <attribute name="id">
918
- <data type="ID"/>
1007
+ <ref name="Image"/>
1008
+ </element>
1009
+ </define>
1010
+ <define name="Image">
1011
+ <attribute name="id">
1012
+ <data type="ID"/>
1013
+ </attribute>
1014
+ <attribute name="src">
1015
+ <data type="anyURI"/>
1016
+ </attribute>
1017
+ <attribute name="mimetype"/>
1018
+ <optional>
1019
+ <attribute name="filename"/>
1020
+ </optional>
1021
+ <optional>
1022
+ <attribute name="width">
1023
+ <ref name="ImageSize"/>
919
1024
  </attribute>
920
- <attribute name="src">
1025
+ </optional>
1026
+ <optional>
1027
+ <attribute name="height">
1028
+ <ref name="ImageSize"/>
1029
+ </attribute>
1030
+ </optional>
1031
+ <optional>
1032
+ <attribute name="alt"/>
1033
+ </optional>
1034
+ <optional>
1035
+ <attribute name="title"/>
1036
+ </optional>
1037
+ <optional>
1038
+ <attribute name="longdesc">
921
1039
  <data type="anyURI"/>
922
1040
  </attribute>
923
- <attribute name="mimetype"/>
924
- <optional>
925
- <attribute name="filename"/>
926
- </optional>
927
- <optional>
928
- <attribute name="width">
929
- <choice>
930
- <data type="int"/>
931
- <value>auto</value>
932
- </choice>
933
- </attribute>
934
- </optional>
935
- <optional>
936
- <attribute name="height">
937
- <choice>
938
- <data type="int"/>
939
- <value>auto</value>
940
- </choice>
941
- </attribute>
942
- </optional>
943
- <optional>
944
- <attribute name="alt"/>
945
- </optional>
946
- <optional>
947
- <attribute name="title"/>
948
- </optional>
949
- <optional>
950
- <attribute name="longdesc">
951
- <data type="anyURI"/>
952
- </attribute>
953
- </optional>
954
- </element>
1041
+ </optional>
1042
+ </define>
1043
+ <define name="ImageSize">
1044
+ <choice>
1045
+ <data type="string">
1046
+ <param name="pattern">\d+([.]\d+)?(%?)</param>
1047
+ </data>
1048
+ <value>auto</value>
1049
+ </choice>
955
1050
  </define>
956
1051
  <define name="video">
957
1052
  <element name="video">
@@ -9,11 +9,42 @@
9
9
  -->
10
10
  <include href="biblio.rng">
11
11
  <define name="BibData">
12
- <ref name="BibliographicItem"/>
12
+ <ref name="StandardBibliographicItem"/>
13
13
  <optional>
14
14
  <ref name="ext"/>
15
15
  </optional>
16
16
  </define>
17
+ <define name="docrelation">
18
+ <element name="relation">
19
+ <attribute name="type">
20
+ <ref name="DocRelationType"/>
21
+ </attribute>
22
+ <optional>
23
+ <element name="description">
24
+ <ref name="FormattedString"/>
25
+ </element>
26
+ </optional>
27
+ <element name="bibitem">
28
+ <ref name="StandardReducedBibliographicItem"/>
29
+ </element>
30
+ <choice>
31
+ <zeroOrMore>
32
+ <ref name="locality"/>
33
+ </zeroOrMore>
34
+ <zeroOrMore>
35
+ <ref name="localityStack"/>
36
+ </zeroOrMore>
37
+ </choice>
38
+ <choice>
39
+ <zeroOrMore>
40
+ <ref name="sourceLocality"/>
41
+ </zeroOrMore>
42
+ <zeroOrMore>
43
+ <ref name="sourceLocalityStack"/>
44
+ </zeroOrMore>
45
+ </choice>
46
+ </element>
47
+ </define>
17
48
  </include>
18
49
  <define name="ext">
19
50
  <element name="ext">
@@ -161,4 +192,16 @@
161
192
  </optional>
162
193
  </element>
163
194
  </define>
195
+ <define name="StandardBibliographicItem">
196
+ <ref name="BibliographicItem"/>
197
+ <zeroOrMore>
198
+ <ref name="amend"/>
199
+ </zeroOrMore>
200
+ </define>
201
+ <define name="StandardReducedBibliographicItem">
202
+ <ref name="ReducedBibliographicItem"/>
203
+ <zeroOrMore>
204
+ <ref name="amend"/>
205
+ </zeroOrMore>
206
+ </define>
164
207
  </grammar>
data/grammars/biblio.rng CHANGED
@@ -241,6 +241,9 @@
241
241
  </element>
242
242
  </define>
243
243
  <define name="FullNameType">
244
+ <optional>
245
+ <ref name="name_abbreviation"/>
246
+ </optional>
244
247
  <choice>
245
248
  <group>
246
249
  <zeroOrMore>
@@ -266,6 +269,11 @@
266
269
  <ref name="variantname"/>
267
270
  </zeroOrMore>
268
271
  </define>
272
+ <define name="name_abbreviation">
273
+ <element name="abbreviation">
274
+ <ref name="LocalizedString"/>
275
+ </element>
276
+ </define>
269
277
  <define name="prefix">
270
278
  <element name="prefix">
271
279
  <ref name="LocalizedString"/>
@@ -348,6 +356,9 @@
348
356
  <zeroOrMore>
349
357
  <ref name="contact"/>
350
358
  </zeroOrMore>
359
+ <optional>
360
+ <ref name="logo"/>
361
+ </optional>
351
362
  </element>
352
363
  </define>
353
364
  <define name="orgname">
@@ -366,6 +377,21 @@
366
377
  </choice>
367
378
  </element>
368
379
  </define>
380
+ <define name="logo">
381
+ <element name="logo">
382
+ <ref name="image"/>
383
+ </element>
384
+ </define>
385
+ <define name="depiction">
386
+ <element name="depiction">
387
+ <optional>
388
+ <attribute name="scope"/>
389
+ </optional>
390
+ <zeroOrMore>
391
+ <ref name="image"/>
392
+ </zeroOrMore>
393
+ </element>
394
+ </define>
369
395
  <define name="NameWithVariants">
370
396
  <element name="primary">
371
397
  <ref name="LocalizedString"/>
@@ -752,6 +778,9 @@
752
778
  <optional>
753
779
  <ref name="validity"/>
754
780
  </optional>
781
+ <optional>
782
+ <ref name="depiction"/>
783
+ </optional>
755
784
  </define>
756
785
  <define name="ReducedBibliographicItem">
757
786
  <optional>
@@ -849,6 +878,9 @@
849
878
  <optional>
850
879
  <ref name="validity"/>
851
880
  </optional>
881
+ <optional>
882
+ <ref name="depiction"/>
883
+ </optional>
852
884
  </define>
853
885
  <define name="btitle">
854
886
  <element name="title">
@@ -1,6 +1,5 @@
1
1
  module RelatonJis
2
2
  class BibliographicItem < RelatonIsoBib::IsoBibliographicItem
3
- DOCTYPES = %w[japanese-industrial-standard technical-report technical-specification amendment].freeze
4
3
  #
5
4
  # Fetch the flavor shcema version
6
5
  #
@@ -0,0 +1,16 @@
1
+ module RelatonJis
2
+ class DocumentType < RelatonBib::DocumentType
3
+ DOCTYPES = %w[japanese-industrial-standard technical-report technical-specification amendment].freeze
4
+
5
+ def initialize(type:, abbreviation: nil)
6
+ check_type type
7
+ super
8
+ end
9
+
10
+ def check_type(type)
11
+ unless DOCTYPES.include? type
12
+ Util.warn "WARNING: invalid doctype: `#{type}`"
13
+ end
14
+ end
15
+ end
16
+ end
@@ -1,9 +1,16 @@
1
1
  module RelatonJis
2
- class HashConverter < RelatonBib::HashConverter
2
+ module HashConverter
3
+ include RelatonBib::HashConverter
4
+ extend self
5
+
3
6
  # @param item_hash [Hash]
4
7
  # @return [Relaton3gpp::BibliographicItem]
5
- def self.bib_item(item_hash)
8
+ def bib_item(item_hash)
6
9
  BibliographicItem.new(**item_hash)
7
10
  end
11
+
12
+ def create_doctype(**args)
13
+ DocumentType.new(**args)
14
+ end
8
15
  end
9
16
  end
@@ -103,12 +103,13 @@ module RelatonJis
103
103
  end
104
104
 
105
105
  def fetch_doctype
106
- case document_id
107
- when /JIS\s[A-Z]\s[\w-]+:\d{4}\/AMENDMENT/ then "amendment"
108
- when /JIS\s[A-Z]\s[\w-]+/ then "japanese-industrial-standard"
109
- when /TR[\s\/][\w-]+/ then "technical-report"
110
- when /TS[\s\/][\w-]+/ then "technical-specification"
111
- end
106
+ type = case document_id
107
+ when /JIS\s[A-Z]\s[\w-]+:\d{4}\/AMENDMENT/ then "amendment"
108
+ when /JIS\s[A-Z]\s[\w-]+/ then "japanese-industrial-standard"
109
+ when /TR[\s\/][\w-]+/ then "technical-report"
110
+ when /TS[\s\/][\w-]+/ then "technical-specification"
111
+ end
112
+ DocumentType.new type: type
112
113
  end
113
114
 
114
115
  def fetch_ics
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonJis
4
- VERSION = "1.16.8"
4
+ VERSION = "1.18.0"
5
5
  end
data/lib/relaton_jis.rb CHANGED
@@ -5,6 +5,7 @@ require "relaton_iso_bib"
5
5
  require_relative "relaton_jis/version"
6
6
  require_relative "relaton_jis/config"
7
7
  require_relative "relaton_jis/util"
8
+ require_relative "relaton_jis/document_type"
8
9
  require_relative "relaton_jis/bibliographic_item"
9
10
  require_relative "relaton_jis/xml_parser"
10
11
  require_relative "relaton_jis/hash_converter"
data/relaton_jis.gemspec CHANGED
@@ -35,7 +35,7 @@ Gem::Specification.new do |spec|
35
35
 
36
36
  # Uncomment to register a new dependency of your gem
37
37
  spec.add_dependency "mechanize", "~> 2.8.0"
38
- spec.add_dependency "relaton-iso-bib", "~> 1.16.0"
38
+ spec.add_dependency "relaton-iso-bib", "~> 1.18.0"
39
39
 
40
40
  # For more information and examples about making a new gem, check out our
41
41
  # guide at: https://bundler.io/guides/creating_gem.html
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-jis
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.16.8
4
+ version: 1.18.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-23 00:00:00.000000000 Z
11
+ date: 2024-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mechanize
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.16.0
33
+ version: 1.18.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 1.16.0
40
+ version: 1.18.0
41
41
  description: 'RelatonJis: retrieve IETF Standards for bibliographic use using the
42
42
  BibliographicItem model'
43
43
  email:
@@ -61,6 +61,7 @@ files:
61
61
  - lib/relaton_jis/bibliographic_item.rb
62
62
  - lib/relaton_jis/bibliography.rb
63
63
  - lib/relaton_jis/config.rb
64
+ - lib/relaton_jis/document_type.rb
64
65
  - lib/relaton_jis/hash_converter.rb
65
66
  - lib/relaton_jis/hit.rb
66
67
  - lib/relaton_jis/hit_collection.rb