tc211-termbase 0.1.11 → 0.1.12

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: e1b3d104ef64dd44e3183124f12c5fe0ac263027c88d5ad270005b7d41f96928
4
- data.tar.gz: df503bb5bbcfed34f3fc9a066e90c40fb46cace48dbf544b7c194d1e8fded62b
3
+ metadata.gz: bbedd674f3ca0d280b3f8921777256f8bdc9c284bc41dbccd84dd5cc0dcd316d
4
+ data.tar.gz: 5ef1960c4e677a1fd393060ee9e503ae4b684eb4bb1c65114e6bfd6e92ceba3a
5
5
  SHA512:
6
- metadata.gz: 8c9b347c742fa57367d62785b60f92e4692db8439c134be632b6389104507ae0e6c7858a14a333ef7a90febe4b33b8fc62dbe7d4e8d6eee53cbaeb93864859d4
7
- data.tar.gz: ebeda081cbc25e5b1aeb401346957cd7cca8ec5731229582e601ee526dbaf1f23256c1a51b4b09191148b53255118db4258a9044373a4cc4c528444291367b29
6
+ metadata.gz: 4fc10ba509e19676c1163da651802cc3621a52568eab9c174a124fb3e29477df07c8720e340c90726eac71f064f25623cea2f0afd8755bcb4507b58fecae355b
7
+ data.tar.gz: 017b323b2a4bb21391c951a16dd38699a3e18bebfca4311ddbddb808552b73f436b5d504d38279d222cab9ed0ee11a64d901731fad18334f924af585f9aa1148
data/.gitignore CHANGED
@@ -2,6 +2,7 @@
2
2
  /.yardoc
3
3
  /_yardoc/
4
4
  /coverage/
5
+ /db/
5
6
  /doc/
6
7
  /pkg/
7
8
  /spec/reports/
data/Gemfile.lock CHANGED
@@ -1,98 +1,102 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tc211-termbase (0.1.11)
4
+ tc211-termbase (0.1.12)
5
5
  creek
6
- iso-639
7
6
  relaton (~> 0.5)
8
7
 
9
8
  GEM
10
9
  remote: https://rubygems.org/
11
10
  specs:
12
- addressable (2.6.0)
13
- public_suffix (>= 2.0.2, < 4.0)
14
- algoliasearch (1.26.1)
15
- httpclient (~> 2.8, >= 2.8.3)
16
- json (>= 1.5.1)
17
- cnccs (0.1.3)
11
+ addressable (2.7.0)
12
+ public_suffix (>= 2.0.2, < 5.0)
13
+ cnccs (0.1.5)
18
14
  creek (2.4.4)
19
15
  http (~> 4.0)
20
16
  nokogiri (>= 1.7.0)
21
17
  rubyzip (>= 1.0.0)
22
- debase (0.2.3)
18
+ debase (0.2.4.1)
23
19
  debase-ruby_core_source (>= 0.10.2)
24
- debase-ruby_core_source (0.10.5)
20
+ debase-ruby_core_source (0.10.6)
25
21
  diff-lcs (1.3)
26
22
  domain_name (0.5.20190701)
27
23
  unf (>= 0.0.5, < 1.0.0)
28
- gb-agencies (0.0.5)
29
- http (4.1.1)
24
+ faraday (0.17.0)
25
+ multipart-post (>= 1.2, < 3)
26
+ ffi (1.11.1)
27
+ ffi-compiler (1.0.1)
28
+ ffi (>= 1.0.0)
29
+ rake
30
+ gb-agencies (0.0.6)
31
+ http (4.2.0)
30
32
  addressable (~> 2.3)
31
33
  http-cookie (~> 1.0)
32
34
  http-form_data (~> 2.0)
33
- http_parser.rb (~> 0.6.0)
35
+ http-parser (~> 1.2.0)
34
36
  http-cookie (1.0.3)
35
37
  domain_name (~> 0.5)
36
38
  http-form_data (2.1.1)
37
- http_parser.rb (0.6.0)
38
- httpclient (2.8.3)
39
- iso-639 (0.2.8)
40
- isoics (0.1.7)
41
- json (2.2.0)
39
+ http-parser (1.2.1)
40
+ ffi-compiler (>= 1.0, < 2.0)
41
+ isoics (0.1.8)
42
42
  mini_portile2 (2.4.0)
43
- nokogiri (1.10.3)
43
+ multipart-post (2.1.1)
44
+ nokogiri (1.10.4)
44
45
  mini_portile2 (~> 2.4.0)
45
- public_suffix (3.1.1)
46
+ public_suffix (4.0.1)
46
47
  rake (10.5.0)
47
- relaton (0.5.1)
48
- algoliasearch
48
+ relaton (0.5.7)
49
49
  relaton-gb (~> 0.6.0)
50
50
  relaton-iec (~> 0.4.0)
51
51
  relaton-ietf (~> 0.6.0)
52
52
  relaton-iso (~> 0.6.0)
53
53
  relaton-itu (~> 0.3.0)
54
54
  relaton-nist (~> 0.3.0)
55
- relaton-bib (0.3.3)
55
+ relaton-ogc (~> 0.1.0)
56
+ relaton-bib (0.3.11)
56
57
  addressable
57
- nokogiri (~> 1.10)
58
- relaton-gb (0.6.1)
58
+ nokogiri
59
+ relaton-gb (0.6.6)
59
60
  cnccs (~> 0.1.1)
60
61
  gb-agencies (~> 0.0.1)
61
62
  relaton-iso-bib (~> 0.3.0)
62
- relaton-iec (0.4.2)
63
+ relaton-iec (0.4.9)
63
64
  addressable
64
65
  relaton-iso-bib (~> 0.3.0)
65
- relaton-ietf (0.6.1)
66
+ relaton-ietf (0.6.7)
66
67
  relaton-bib (~> 0.3.0)
67
- relaton-iso (0.6.2)
68
+ relaton-iso (0.6.8)
68
69
  relaton-iec (~> 0.4.0)
69
70
  relaton-iso-bib (~> 0.3.0)
70
- relaton-iso-bib (0.3.2)
71
+ relaton-iso-bib (0.3.11)
71
72
  isoics (~> 0.1.6)
72
73
  relaton-bib (~> 0.3.0)
73
74
  ruby_deep_clone (~> 0.8.0)
74
- relaton-itu (0.3.1)
75
+ relaton-itu (0.3.6)
75
76
  relaton-iso-bib (~> 0.3.0)
76
- relaton-nist (0.3.1)
77
+ relaton-nist (0.3.7)
77
78
  relaton-bib (~> 0.3.0)
78
79
  rubyzip
79
- rspec (3.8.0)
80
- rspec-core (~> 3.8.0)
81
- rspec-expectations (~> 3.8.0)
82
- rspec-mocks (~> 3.8.0)
83
- rspec-core (3.8.2)
84
- rspec-support (~> 3.8.0)
85
- rspec-expectations (3.8.4)
80
+ relaton-ogc (0.1.3)
81
+ faraday
82
+ relaton-iso-bib (~> 0.3.0)
83
+ rspec (3.9.0)
84
+ rspec-core (~> 3.9.0)
85
+ rspec-expectations (~> 3.9.0)
86
+ rspec-mocks (~> 3.9.0)
87
+ rspec-core (3.9.0)
88
+ rspec-support (~> 3.9.0)
89
+ rspec-expectations (3.9.0)
86
90
  diff-lcs (>= 1.2.0, < 2.0)
87
- rspec-support (~> 3.8.0)
88
- rspec-mocks (3.8.1)
91
+ rspec-support (~> 3.9.0)
92
+ rspec-mocks (3.9.0)
89
93
  diff-lcs (>= 1.2.0, < 2.0)
90
- rspec-support (~> 3.8.0)
91
- rspec-support (3.8.2)
94
+ rspec-support (~> 3.9.0)
95
+ rspec-support (3.9.0)
92
96
  ruby-debug-ide (0.7.0)
93
97
  rake (>= 0.8.1)
94
98
  ruby_deep_clone (0.8.0)
95
- rubyzip (1.2.3)
99
+ rubyzip (2.0.0)
96
100
  unf (0.1.4)
97
101
  unf_ext
98
102
  unf_ext (0.0.7.6)
@@ -1,11 +1,10 @@
1
1
  require_relative "metadata_section"
2
2
  require_relative "terms_section"
3
- require "iso-639"
4
3
 
5
4
  module Tc211::Termbase
6
5
 
7
6
  class TerminologySheet
8
- attr_accessor :sheet
7
+ attr_accessor :sheet, :language_code
9
8
 
10
9
  def initialize(sheet)
11
10
  @sheet = sheet
@@ -17,18 +16,23 @@ class TerminologySheet
17
16
  end
18
17
 
19
18
  def language_code
20
- # Hack to make ISO_639 gem work...
21
- lang = case language
22
- when "Dutch"
23
- "Dutch; Flemish"
24
- when "Spanish"
25
- "Spanish; Castilian"
19
+ return @language_code unless @language_code.nil?
20
+ raise StandardError.new("Language code not parsed yet for sheet: #{language}")
21
+ end
22
+
23
+ # Read language_code from sheet
24
+ def set_language_code(code)
25
+ # puts "language_code is #{code}"
26
+ return @language_code unless @language_code.nil?
27
+
28
+ @language_code = case code
29
+ when "dut/nld"
30
+ "dut"
31
+ when "工作语言代码"
32
+ "chn"
26
33
  else
27
- language
34
+ code
28
35
  end
29
- ISO_639.find_by_english_name(lang).alpha3
30
- rescue
31
- raise StandardError.new("Failed to find alpha3 code for language: #{lang}")
32
36
  end
33
37
 
34
38
  def sections_raw
@@ -72,7 +76,7 @@ class TerminologySheet
72
76
  break if section
73
77
  begin
74
78
  # puts "rows: #{x.inspect}"
75
- section = ::Tc211::Termbase.const_get(t).new(x, {language_code: language_code})
79
+ section = ::Tc211::Termbase.const_get(t).new(x, {parent_sheet: self})
76
80
  rescue SheetSection::RowHeaderMatchError
77
81
  end
78
82
  end
@@ -81,6 +85,17 @@ class TerminologySheet
81
85
  raise SheetSection::UnknownHeaderError.new("Unable to find header row match for section #{i} header, contents: #{x.inspect}")
82
86
  end
83
87
 
88
+ # MetadataSections always go first, so the language_code must already
89
+ # be set at the time of parsing the TermsSection
90
+ if section.is_a?(MetadataSection)
91
+ code = section.fields["operating-language-code"]
92
+ # puts "lang code is detected as #{code}, #{@language_code}"
93
+ unless code.nil?
94
+ # puts "setting lang code is detected as #{code}"
95
+ set_language_code(code)
96
+ end
97
+ end
98
+
84
99
  puts "--------- Section #{i} is a #{section.class.name} ---------"
85
100
 
86
101
  @sections << section
@@ -85,7 +85,7 @@ module Tc211::Termbase
85
85
  @mapping_rows = @rows[0..1]
86
86
  @header_row = @rows[2]
87
87
  @body_rows = @rows[3..-1]
88
- @language_code = options.delete(:language_code)
88
+ @language_code = options.delete(:parent_sheet).language_code
89
89
  self
90
90
  end
91
91
 
@@ -1,5 +1,5 @@
1
1
  module Tc211
2
2
  module Termbase
3
- VERSION = "0.1.11"
3
+ VERSION = "0.1.12"
4
4
  end
5
5
  end
@@ -22,7 +22,6 @@ Gem::Specification.new do |spec|
22
22
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
23
  spec.require_paths = ["lib"]
24
24
 
25
- spec.add_runtime_dependency "iso-639"
26
25
  spec.add_runtime_dependency "creek"
27
26
  spec.add_runtime_dependency "relaton", "~> 0.5"
28
27
 
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tc211-termbase
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.11
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-08-12 00:00:00.000000000 Z
11
+ date: 2019-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: iso-639
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: creek
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -140,20 +126,6 @@ files:
140
126
  - Rakefile
141
127
  - bin/console
142
128
  - bin/setup
143
- - db/iso/iso_1087_1_2000.xml
144
- - db/iso/iso_19101_1_2014.xml
145
- - db/iso/iso_19105.xml
146
- - db/iso/iso_19105_2000.xml
147
- - db/iso/iso_19110_2005_amd_1_2011.xml
148
- - db/iso/iso_19116.xml
149
- - db/iso/iso_19116_2004.xml
150
- - db/iso/iso_19117_2012.xml
151
- - db/iso/iso_3534_1.xml
152
- - db/iso/iso_3534_1_1993.xml
153
- - db/iso/iso_iec_19501.xml
154
- - db/iso/iso_iec_19501_2005.xml
155
- - db/iso/iso_iec_2382_17_1999.xml
156
- - db/version
157
129
  - exe/tc211-termbase-xlsx2yaml
158
130
  - lib/tc211/termbase.rb
159
131
  - lib/tc211/termbase/concept.rb
@@ -1,72 +0,0 @@
1
- <bibdata type="standard">
2
- <fetched>2019-08-06</fetched>
3
- <title type="title-intro" format="text/plain" language="en" script="Latn">Terminology work</title>
4
- <title type="title-main" format="text/plain" language="en" script="Latn">Vocabulary</title>
5
- <title type="title-part" format="text/plain" language="en" script="Latn">Part 1: Theory and application</title>
6
- <title type="main" format="text/plain" language="en" script="Latn">Terminology work - Vocabulary - Part 1: Theory and application</title>
7
- <title type="title-intro" format="text/plain" language="fr" script="Latn">Travaux terminologiques</title>
8
- <title type="title-main" format="text/plain" language="fr" script="Latn">Vocabulaire</title>
9
- <title type="title-part" format="text/plain" language="fr" script="Latn">Partie 1: Théorie et application</title>
10
- <title type="main" format="text/plain" language="fr" script="Latn">Travaux terminologiques - Vocabulaire - Partie 1: Théorie et application</title>
11
- <uri type="src">https://www.iso.org/standard/20057.html</uri>
12
- <uri type="obp">https://www.iso.org/obp/ui/#!iso:std:20057:en</uri>
13
- <uri type="rss">https://www.iso.org/contents/data/standard/02/00/20057.detail.rss</uri>
14
- <docidentifier type="ISO">ISO 1087-1:2000</docidentifier>
15
- <date type="published">
16
- <on>2000</on>
17
- </date>
18
- <contributor>
19
- <role type="publisher"/>
20
- <organization>
21
- <name>International Organization for Standardization</name>
22
- <abbreviation>ISO</abbreviation>
23
- <uri>www.iso.org</uri>
24
- </organization>
25
- </contributor>
26
- <edition>1</edition>
27
- <language>en</language>
28
- <language>fr</language>
29
- <script>Latn</script>
30
- <abstract format="text/plain" language="fr" script="Latn">&#13;
31
- La présente Norme internationale établit le vocabulaire fondamental de la théorie et de la pratique du travail terminologique. Elle n'inclut pas le vocabulaire traitant des applications informatiques du travail terminologique, qui est couvert par l'ISO 1087-2. La présentation obéit à l'ISO 10241, sauf spécification contraire.&#13;
32
- </abstract>
33
- <status>
34
- <stage>90</stage>
35
- <substage>92</substage>
36
- </status>
37
- <copyright>
38
- <from>2000</from>
39
- <owner>
40
- <organization>
41
- <name>ISO</name>
42
- </organization>
43
- </owner>
44
- </copyright>
45
- <relation type="obsoletes">
46
- <bibitem type="standard">
47
- <formattedref format="text/plain">ISO 1087:1990</formattedref>
48
- </bibitem>
49
- </relation>
50
- <relation type="obsoletes">
51
- <bibitem type="standard">
52
- <formattedref format="text/plain">ISO/FDIS 1087</formattedref>
53
- </bibitem>
54
- </relation>
55
- <ext>
56
- <doctype>international-standard</doctype>
57
- <editorialgroup>
58
- <technical_committee number="37" type="TC">ISO/TC 37/SC 1Principles and methods</technical_committee>
59
- </editorialgroup>
60
- <ics>
61
- <code>01.020</code>
62
- <text>Terminology (principles and coordination)</text>
63
- </ics>
64
- <ics>
65
- <code>01.040.01</code>
66
- <text>Generalities. Terminology. Standardization. Documentation (Vocabularies)</text>
67
- </ics>
68
- <structuredidentifier type="ISO">
69
- <project-number>ISO 1087</project-number>
70
- </structuredidentifier>
71
- </ext>
72
- </bibdata>
@@ -1,62 +0,0 @@
1
- <bibdata type="standard">
2
- <fetched>2019-08-06</fetched>
3
- <title type="title-intro" format="text/plain" language="en" script="Latn">Geographic information</title>
4
- <title type="title-main" format="text/plain" language="en" script="Latn">Reference model</title>
5
- <title type="title-part" format="text/plain" language="en" script="Latn">Part 1: Fundamentals</title>
6
- <title type="main" format="text/plain" language="en" script="Latn">Geographic information - Reference model - Part 1: Fundamentals</title>
7
- <title type="title-intro" format="text/plain" language="fr" script="Latn">Information géographique</title>
8
- <title type="title-main" format="text/plain" language="fr" script="Latn">Modèle de référence</title>
9
- <title type="title-part" format="text/plain" language="fr" script="Latn">Partie 1: Principes de base</title>
10
- <title type="main" format="text/plain" language="fr" script="Latn">Information géographique - Modèle de référence - Partie 1: Principes de base</title>
11
- <uri type="src">https://www.iso.org/standard/59164.html</uri>
12
- <uri type="obp">https://www.iso.org/obp/ui/#!iso:std:59164:en</uri>
13
- <uri type="rss">https://www.iso.org/contents/data/standard/05/91/59164.detail.rss</uri>
14
- <docidentifier type="ISO">ISO 19101-1:2014</docidentifier>
15
- <date type="published">
16
- <on>2014</on>
17
- </date>
18
- <contributor>
19
- <role type="publisher"/>
20
- <organization>
21
- <name>International Organization for Standardization</name>
22
- <abbreviation>ISO</abbreviation>
23
- <uri>www.iso.org</uri>
24
- </organization>
25
- </contributor>
26
- <edition>1</edition>
27
- <language>en</language>
28
- <language>fr</language>
29
- <script>Latn</script>
30
- <abstract format="text/plain" language="en" script="Latn">ISO 19101-1:2014 defines the reference model for standardization in the field of geographic information. This reference model describes the notion of interoperability and sets forth the fundamentals by which this standardization takes place.Although structured in the context of information technology and information technology standards, ISO 19101-1:2014 is independent of any application development method or technology implementation approach.</abstract>
31
- <abstract format="text/plain" language="fr" script="Latn">l'ISO 19101-1:2014 définit le modèle de référence pour la normalisation dans le domaine de l'information géographique. Ce modèle de référence décrit la notion d'interopérabilité et établit les principes de base sur lesquels s'appuiera la normalisation.Bien que l'ISO 19101-1:2014 soit définie dans le contexte des technologies de l'information et des normes s'y rapportant, elle ne dépend d'aucune méthode de développement d'applications, ni d'aucune approche de mise en ?uvre de technologie.</abstract>
32
- <status>
33
- <stage>60</stage>
34
- <substage>60</substage>
35
- </status>
36
- <copyright>
37
- <from>2014</from>
38
- <owner>
39
- <organization>
40
- <name>ISO</name>
41
- </organization>
42
- </owner>
43
- </copyright>
44
- <relation type="obsoletes">
45
- <bibitem type="standard">
46
- <formattedref format="text/plain">ISO 19101:2002</formattedref>
47
- </bibitem>
48
- </relation>
49
- <ext>
50
- <doctype>international-standard</doctype>
51
- <editorialgroup>
52
- <technical_committee number="211" type="TC">ISO/TC 211Geographic information/Geomatics</technical_committee>
53
- </editorialgroup>
54
- <ics>
55
- <code>35.240.70</code>
56
- <text>IT applications in science</text>
57
- </ics>
58
- <structuredidentifier type="ISO">
59
- <project-number>ISO 19101</project-number>
60
- </structuredidentifier>
61
- </ext>
62
- </bibdata>