relaton-ietf 1.13.4 → 1.13.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/relaton_ietf/bibxml_parser.rb +91 -33
- data/lib/relaton_ietf/rfc_entry.rb +6 -42
- data/lib/relaton_ietf/version.rb +1 -1
- data/relaton_ietf.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d5d9ec768b99a9f7dc61438afe510562005322438b5fff41fe04069111d73e0
|
4
|
+
data.tar.gz: 410398ba75786d32f94fb8e90303f507e6842b5eee84d57c3647bee8d539975c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2bf9b65a7fd0e7b4702ddf9b35e8be78a308dccfaa85b83b9def4ea37192718abced81fb02e58d356ee600b421cde8deb190e8e3ffa10adc5882fad10b6db92b
|
7
|
+
data.tar.gz: 1edd378c32a456117f226dbef2b851f761e50e618b8962e022df096ac1557f7f081b1010c5e1cd22986b92b3bb593d58848703105631eb4f01b612f5e8fe3456
|
@@ -3,25 +3,6 @@ module RelatonIetf
|
|
3
3
|
include RelatonBib::BibXMLParser
|
4
4
|
extend BibXMLParser
|
5
5
|
|
6
|
-
FULLNAMEORG = [
|
7
|
-
"IAB", "Internet Architecture Board", "IAB and IESG", "IESG",
|
8
|
-
"IAB Advisory Committee", "Internet Engineering Steering Group",
|
9
|
-
"Network Information Center. Stanford Research Institute",
|
10
|
-
"Information Sciences Institute University of Southern California",
|
11
|
-
"International Telegraph and Telephone Consultative Committee of the International Telecommunication Union",
|
12
|
-
"National Bureau of Standards", "International Organization for Standardization",
|
13
|
-
"National Research Council", "Gateway Algorithms and Data Structures Task Force",
|
14
|
-
"National Science Foundation", "Network Technical Advisory Group",
|
15
|
-
"NetBIOS Working Group in the Defense Advanced Research Projects Agency",
|
16
|
-
"Internet Activities Board", "End-to-End Services Task Force",
|
17
|
-
"Defense Advanced Research Projects Agency", "The North American Directory Forum",
|
18
|
-
"ESCC X.500/X.400 Task Force", "ESnet Site Coordinating Comittee (ESCC)",
|
19
|
-
"Energy Sciences Network (ESnet)", "RARE WG-MSG Task Force 88",
|
20
|
-
"Internet Assigned Numbers Authority (IANA)", "Federal Networking Council",
|
21
|
-
"Audio-Video Transport Working Group", "KOI8-U Working Group",
|
22
|
-
"The Internet Society", "Sun Microsystems"
|
23
|
-
].freeze
|
24
|
-
|
25
6
|
# @param attrs [Hash]
|
26
7
|
# @return [RelatonIetf::IetfBibliographicItem]
|
27
8
|
def bib_item(**attrs)
|
@@ -68,30 +49,107 @@ module RelatonIetf
|
|
68
49
|
contribs + super
|
69
50
|
end
|
70
51
|
|
52
|
+
def person(author, reference)
|
53
|
+
full_name_org(author[:fullname]) || super
|
54
|
+
end
|
55
|
+
|
56
|
+
def full_name_org(name) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Metrics/CyclomaticComplexity
|
57
|
+
case name
|
58
|
+
when "ISO"
|
59
|
+
RelatonBib::Organization.new(abbreviation: name, name: "International Organization for Standardization")
|
60
|
+
when "IAB"
|
61
|
+
RelatonBib::Organization.new(abbreviation: name, name: "Internet Architecture Board")
|
62
|
+
when "IESG"
|
63
|
+
RelatonBib::Organization.new(abbreviation: name, name: "Internet Engineering Steering Group")
|
64
|
+
when "IANA"
|
65
|
+
RelatonBib::Organization.new(abbreviation: name, name: "Internet Assigned Numbers Authority")
|
66
|
+
when "International Organization for Standardization"
|
67
|
+
RelatonBib::Organization.new(abbreviation: "ISO", name: name)
|
68
|
+
when "Federal Networking Council", "Internet Architecture Board", "Internet Activities Board",
|
69
|
+
"Defense Advanced Research Projects Agency", "National Science Foundation",
|
70
|
+
"National Research Council", "National Bureau of Standards",
|
71
|
+
"Internet Engineering Steering Group"
|
72
|
+
abbr = name.split.map { |w| w[0] if w[0] == w[0].upcase }.join
|
73
|
+
RelatonBib::Organization.new(abbreviation: abbr, name: name)
|
74
|
+
when "IETF Secretariat"
|
75
|
+
RelatonBib::Organization.new(abbreviation: "IETF", name: name)
|
76
|
+
when "Audio-Video Transport Working Group", /North American Directory Forum/, "EARN Staff",
|
77
|
+
"Vietnamese Standardization Working Group", "ACM SIGUCCS", "ESCC X.500/X.400 Task Force",
|
78
|
+
"Sun Microsystems", "NetBIOS Working Group in the Defense Advanced Research Projects Agency",
|
79
|
+
"End-to-End Services Task Force", "Network Technical Advisory Group", "Bolt Beranek",
|
80
|
+
"Newman Laboratories", "Gateway Algorithms and Data Structures Task Force",
|
81
|
+
"Network Information Center. Stanford Research Institute", "RFC Editor",
|
82
|
+
"Information Sciences Institute University of Southern California", "IAB and IESG",
|
83
|
+
"RARE WG-MSG Task Force 88", "KOI8-U Working Group", "The Internet Society",
|
84
|
+
"IAB Advisory Committee", "ISOC Board of Trustees", "Mitra", "RFC Editor, et al."
|
85
|
+
RelatonBib::Organization.new(name: name)
|
86
|
+
when "Internet Assigned Numbers Authority (IANA)"
|
87
|
+
RelatonBib::Organization.new(abbreviation: "IANA", name: "Internet Assigned Numbers Authority (IANA)")
|
88
|
+
when "ESnet Site Coordinating Comittee (ESCC)"
|
89
|
+
RelatonBib::Organization.new(abbreviation: "ESCC", name: "ESnet Site Coordinating Comittee (ESCC)")
|
90
|
+
when "Energy Sciences Network (ESnet)"
|
91
|
+
RelatonBib::Organization.new(abbreviation: "ESnet", name: "Energy Sciences Network (ESnet)")
|
92
|
+
when "International Telegraph and Telephone Consultative Committee of the International Telecommunication Union"
|
93
|
+
RelatonBib::Organization.new(abbreviation: "CCITT", name: name)
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
71
97
|
#
|
72
98
|
# Overrade RelatonBib::BibXMLParser#full_name method
|
73
99
|
#
|
74
|
-
# @param
|
75
|
-
# @param
|
100
|
+
# @param fname [String] full name
|
101
|
+
# @param sname [String, nil] surname
|
102
|
+
# @param fname [String, nil] first name
|
103
|
+
# @param lang [String, nil] language
|
104
|
+
# @param script [String, nil] script
|
76
105
|
#
|
77
106
|
# @return [RelatonBib::FullName]
|
78
107
|
#
|
79
|
-
def full_name(
|
80
|
-
|
81
|
-
|
82
|
-
initials = localized_string(inits, lang)
|
108
|
+
def full_name(fname, sname, inits, lang, script = nil)
|
109
|
+
surname, ints, name = parse_surname_initials fname, sname, inits
|
110
|
+
initials = localized_string(ints, lang, script)
|
83
111
|
RelatonBib::FullName.new(
|
84
|
-
completename: localized_string(
|
85
|
-
initials: initials, forename: forename(
|
86
|
-
surname: localized_string(
|
112
|
+
completename: localized_string(fname, lang, script),
|
113
|
+
initials: initials, forename: forename(ints, name, lang, script),
|
114
|
+
surname: localized_string(surname, lang, script)
|
87
115
|
)
|
88
116
|
end
|
89
117
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
118
|
+
#
|
119
|
+
# Create forenames with initials
|
120
|
+
#
|
121
|
+
# @param [String] initials initials
|
122
|
+
# @param [String] lang language
|
123
|
+
#
|
124
|
+
# @return [Array<RelatonBib::Forename>] forenames
|
125
|
+
#
|
126
|
+
def forename(initials, name, lang = nil, script = nil)
|
127
|
+
fnames = []
|
128
|
+
if name
|
129
|
+
fnames << RelatonBib::Forename.new(content: name, language: lang, script: script)
|
130
|
+
end
|
131
|
+
return fnames unless initials
|
132
|
+
|
133
|
+
initials.split(/\.-?\s?|\s/).each_with_object(fnames) do |i, a|
|
134
|
+
a << RelatonBib::Forename.new(initial: i, language: lang, script: script)
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
#
|
139
|
+
# Parse name, surname, and initials from full name
|
140
|
+
#
|
141
|
+
# @param [String] fname full name
|
142
|
+
# @param [String, nil] sname surname
|
143
|
+
# @param [String, nil] inits
|
144
|
+
#
|
145
|
+
# @return [Array<String, nil>] surname, initials, forename
|
146
|
+
#
|
147
|
+
def parse_surname_initials(fname, sname, inits)
|
148
|
+
regex = /(?:(?<name>\w{3,})\s)?(?<inits>(?:[A-Z]{1,2}(?:\.[\s-]?|\s))+)?/
|
149
|
+
match = fname.match(regex)
|
150
|
+
surname = sname || fname.sub(regex, "").strip
|
151
|
+
initials = inits || match[:inits]&.strip
|
152
|
+
[surname, initials, match[:name]]
|
95
153
|
end
|
96
154
|
end
|
97
155
|
end
|
@@ -149,48 +149,12 @@ module RelatonIetf
|
|
149
149
|
#
|
150
150
|
# @return [Array<RelatonBib::ContributionInfo>] document contributors
|
151
151
|
#
|
152
|
-
def parse_contributor
|
153
|
-
@doc.xpath("./xmlns:author").map do |contrib|
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
when "International Organization for Standardization"
|
159
|
-
entity = RelatonBib::Organization.new(abbrev: "ISO", name: n)
|
160
|
-
when /#{RelatonBib::BibXMLParser::FULLNAMEORG.join("|")}/
|
161
|
-
abbr = n.upcase == n ? n : n.split.reduce([]) { |a, w| w == w.upcase ? break : a << w[0] }&.join
|
162
|
-
entity = RelatonBib::Organization.new(abbrev: abbr, name: n)
|
163
|
-
when "Federal Networking Council", "Internet Activities Board",
|
164
|
-
"Defense Advanced Research Projects Agency", "National Science Foundation",
|
165
|
-
"National Research Council", "National Bureau of Standards"
|
166
|
-
abbr = n.split.map { |w| w[0] if w[0] == w[0].upcase }.join
|
167
|
-
entity = RelatonBib::Organization.new(abbrev: abbr, name: n)
|
168
|
-
when "IETF Secretariat"
|
169
|
-
entity = RelatonBib::Organization.new(abbrev: "IETF", name: n)
|
170
|
-
when "Audio-Video Transport Working Group", /North American Directory Forum/, "EARN Staff",
|
171
|
-
"Vietnamese Standardization Working Group", "ACM SIGUCCS", "ESCC X.500/X.400 Task Force",
|
172
|
-
"Sun Microsystems", "NetBIOS Working Group in the Defense Advanced Research Projects Agency",
|
173
|
-
"End-to-End Services Task Force", "Network Technical Advisory Group", "Bolt Beranek",
|
174
|
-
"Newman Laboratories", "Gateway Algorithms and Data Structures Task Force",
|
175
|
-
"Network Information Center. Stanford Research Institute", "RFC Editor",
|
176
|
-
"Information Sciences Institute University of Southern California",
|
177
|
-
"RARE WG-MSG Task Force 88", "KOI8-U Working Group", "The Internet Society"
|
178
|
-
entity = RelatonBib::Organization.new(name: n)
|
179
|
-
when "Internet Assigned Numbers Authority (IANA)"
|
180
|
-
entity = RelatonBib::Organization.new(abbrev: "IANA", name: "Internet Assigned Numbers Authority (IANA)")
|
181
|
-
when "ESnet Site Coordinating Comittee (ESCC)"
|
182
|
-
entity = RelatonBib::Organization.new(abbrev: "ESCC", name: "ESnet Site Coordinating Comittee (ESCC)")
|
183
|
-
when "Energy Sciences Network (ESnet)"
|
184
|
-
entity = RelatonBib::Organization.new(abbrev: "ESnet", name: "Energy Sciences Network (ESnet)")
|
185
|
-
when "International Telegraph and Telephone Consultative Committee of the International Telecommunication Union"
|
186
|
-
entity = RelatonBib::Organization.new(abbrev: "CCITT", name: n)
|
187
|
-
else
|
188
|
-
/^(?:(?<int>(?:\p{Lu}+(?:-\w|\(\w\))?\.{0,2}[-\s]?)+)\s)?(?<snm>[[:alnum:]\s'-.]+)$/ =~ n
|
189
|
-
surname = RelatonBib::LocalizedString.new(snm, "en", "Latn")
|
190
|
-
name = RelatonBib::LocalizedString.new(n, "en", "Latn")
|
191
|
-
fname = RelatonBib::FullName.new(
|
192
|
-
completename: name, initials: int, forename: forename(int), surname: surname,
|
193
|
-
)
|
152
|
+
def parse_contributor
|
153
|
+
@doc.xpath("./xmlns:author").map do |contrib|
|
154
|
+
name = contrib.at("./xmlns:name").text
|
155
|
+
entity = BibXMLParser.full_name_org name
|
156
|
+
unless entity
|
157
|
+
fname = BibXMLParser.full_name name, nil, nil, "en", "Latn"
|
194
158
|
entity = RelatonBib::Person.new(name: fname)
|
195
159
|
end
|
196
160
|
RelatonBib::ContributionInfo.new(entity: entity, role: parse_role(contrib))
|
data/lib/relaton_ietf/version.rb
CHANGED
data/relaton_ietf.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-ietf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.13.
|
4
|
+
version: 1.13.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-10-
|
11
|
+
date: 2022-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: equivalent-xml
|
@@ -128,14 +128,14 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 1.13.
|
131
|
+
version: 1.13.11
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 1.13.
|
138
|
+
version: 1.13.11
|
139
139
|
description: "RelatonIetf: retrieve IETF Standards for bibliographic use \nusing the
|
140
140
|
BibliographicItem model.\n\nFormerly known as rfcbib.\n"
|
141
141
|
email:
|