glossarist 2.8.14 → 2.8.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CLAUDE.md +25 -0
- data/README.adoc +265 -18
- data/lib/glossarist/bibliography_data.rb +28 -20
- data/lib/glossarist/bibliography_entry.rb +15 -4
- data/lib/glossarist/collections/figure_collection.rb +20 -0
- data/lib/glossarist/collections/formula_collection.rb +20 -0
- data/lib/glossarist/collections/non_verbal_collection.rb +51 -0
- data/lib/glossarist/collections/table_collection.rb +20 -0
- data/lib/glossarist/collections.rb +8 -0
- data/lib/glossarist/figure.rb +39 -0
- data/lib/glossarist/figure_image.rb +30 -0
- data/lib/glossarist/figure_reference.rb +18 -0
- data/lib/glossarist/formula.rb +19 -0
- data/lib/glossarist/formula_reference.rb +18 -0
- data/lib/glossarist/localized_string.rb +44 -0
- data/lib/glossarist/managed_concept_data.rb +49 -0
- data/lib/glossarist/non_verb_rep.rb +14 -18
- data/lib/glossarist/non_verbal_entity.rb +45 -0
- data/lib/glossarist/non_verbal_reference.rb +23 -0
- data/lib/glossarist/reference_extractor.rb +28 -2
- data/lib/glossarist/shared_non_verbal_entity.rb +29 -0
- data/lib/glossarist/table.rb +19 -0
- data/lib/glossarist/table_reference.rb +18 -0
- data/lib/glossarist/transforms/concept_to_gloss_transform.rb +8 -2
- data/lib/glossarist/v3.rb +0 -8
- data/lib/glossarist/validation/asset_index.rb +7 -2
- data/lib/glossarist/validation/bibliography_index.rb +3 -32
- data/lib/glossarist/validation/rules/bibliography_yaml_rule.rb +1 -1
- data/lib/glossarist/validation/rules/gcr_context.rb +0 -1
- data/lib/glossarist/validation/rules/orphaned_images_rule.rb +1 -23
- data/lib/glossarist/version.rb +1 -1
- data/lib/glossarist.rb +11 -0
- metadata +17 -6
- data/lib/glossarist/v3/bibliography_entry.rb +0 -19
- data/lib/glossarist/v3/bibliography_file.rb +0 -27
- data/lib/glossarist/v3/image_entry.rb +0 -21
- data/lib/glossarist/v3/image_file.rb +0 -31
|
@@ -23,9 +23,7 @@ module Glossarist
|
|
|
23
23
|
next unless text
|
|
24
24
|
|
|
25
25
|
extractor.extract_from_text(text).each do |ref|
|
|
26
|
-
if ref.is_a?(AssetReference)
|
|
27
|
-
referenced_paths.add(ref.path)
|
|
28
|
-
end
|
|
26
|
+
referenced_paths.add(ref.path) if ref.is_a?(AssetReference)
|
|
29
27
|
end
|
|
30
28
|
end
|
|
31
29
|
end
|
|
@@ -35,16 +33,6 @@ module Glossarist
|
|
|
35
33
|
end
|
|
36
34
|
end
|
|
37
35
|
|
|
38
|
-
images_file = load_images_file(context)
|
|
39
|
-
if images_file
|
|
40
|
-
context.bibliography_index.entries.each_value do |entry|
|
|
41
|
-
next unless entry[:source].is_a?(V3::ImageEntry)
|
|
42
|
-
|
|
43
|
-
path = entry[:source].path
|
|
44
|
-
referenced_paths.add(path) if path
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
|
|
48
36
|
issues = []
|
|
49
37
|
context.asset_index.each_path do |path|
|
|
50
38
|
next if referenced_paths.include?(path)
|
|
@@ -59,16 +47,6 @@ module Glossarist
|
|
|
59
47
|
|
|
60
48
|
issues
|
|
61
49
|
end
|
|
62
|
-
|
|
63
|
-
private
|
|
64
|
-
|
|
65
|
-
def load_images_file(context)
|
|
66
|
-
return @load_images_file if defined?(@load_images_file)
|
|
67
|
-
|
|
68
|
-
@load_images_file = V3::ImageFile.from_file(
|
|
69
|
-
File.join(context.path, "images.yaml"),
|
|
70
|
-
)
|
|
71
|
-
end
|
|
72
50
|
end
|
|
73
51
|
end
|
|
74
52
|
end
|
data/lib/glossarist/version.rb
CHANGED
data/lib/glossarist.rb
CHANGED
|
@@ -38,6 +38,17 @@ module Glossarist
|
|
|
38
38
|
autoload :ConceptDocument, "glossarist/concept_document"
|
|
39
39
|
autoload :ConceptEnricher, "glossarist/concept_enricher"
|
|
40
40
|
autoload :Config, "glossarist/config"
|
|
41
|
+
autoload :LocalizedString, "glossarist/localized_string"
|
|
42
|
+
autoload :NonVerbalEntity, "glossarist/non_verbal_entity"
|
|
43
|
+
autoload :SharedNonVerbalEntity, "glossarist/shared_non_verbal_entity"
|
|
44
|
+
autoload :NonVerbalReference, "glossarist/non_verbal_reference"
|
|
45
|
+
autoload :Figure, "glossarist/figure"
|
|
46
|
+
autoload :FigureImage, "glossarist/figure_image"
|
|
47
|
+
autoload :FigureReference, "glossarist/figure_reference"
|
|
48
|
+
autoload :Table, "glossarist/table"
|
|
49
|
+
autoload :TableReference, "glossarist/table_reference"
|
|
50
|
+
autoload :Formula, "glossarist/formula"
|
|
51
|
+
autoload :FormulaReference, "glossarist/formula_reference"
|
|
41
52
|
autoload :DatasetValidator, "glossarist/dataset_validator"
|
|
42
53
|
autoload :CustomLocality, "glossarist/custom_locality"
|
|
43
54
|
autoload :DetailedDefinition, "glossarist/detailed_definition"
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: glossarist
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.8.
|
|
4
|
+
version: 2.8.16
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-06-
|
|
11
|
+
date: 2026-06-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: lutaml-model
|
|
@@ -195,7 +195,11 @@ files:
|
|
|
195
195
|
- lib/glossarist/collections/concept_source_collection.rb
|
|
196
196
|
- lib/glossarist/collections/designation_collection.rb
|
|
197
197
|
- lib/glossarist/collections/detailed_definition_collection.rb
|
|
198
|
+
- lib/glossarist/collections/figure_collection.rb
|
|
199
|
+
- lib/glossarist/collections/formula_collection.rb
|
|
198
200
|
- lib/glossarist/collections/localization_collection.rb
|
|
201
|
+
- lib/glossarist/collections/non_verbal_collection.rb
|
|
202
|
+
- lib/glossarist/collections/table_collection.rb
|
|
199
203
|
- lib/glossarist/collections/typed_collection.rb
|
|
200
204
|
- lib/glossarist/comparison_result.rb
|
|
201
205
|
- lib/glossarist/concept.rb
|
|
@@ -235,6 +239,11 @@ files:
|
|
|
235
239
|
- lib/glossarist/errors/invalid_type_error.rb
|
|
236
240
|
- lib/glossarist/errors/load_error.rb
|
|
237
241
|
- lib/glossarist/errors/parse_error.rb
|
|
242
|
+
- lib/glossarist/figure.rb
|
|
243
|
+
- lib/glossarist/figure_image.rb
|
|
244
|
+
- lib/glossarist/figure_reference.rb
|
|
245
|
+
- lib/glossarist/formula.rb
|
|
246
|
+
- lib/glossarist/formula_reference.rb
|
|
238
247
|
- lib/glossarist/gcr_metadata.rb
|
|
239
248
|
- lib/glossarist/gcr_package.rb
|
|
240
249
|
- lib/glossarist/gcr_package_definition.rb
|
|
@@ -244,10 +253,13 @@ files:
|
|
|
244
253
|
- lib/glossarist/glossary_store.rb
|
|
245
254
|
- lib/glossarist/locality.rb
|
|
246
255
|
- lib/glossarist/localized_concept.rb
|
|
256
|
+
- lib/glossarist/localized_string.rb
|
|
247
257
|
- lib/glossarist/managed_concept.rb
|
|
248
258
|
- lib/glossarist/managed_concept_collection.rb
|
|
249
259
|
- lib/glossarist/managed_concept_data.rb
|
|
250
260
|
- lib/glossarist/non_verb_rep.rb
|
|
261
|
+
- lib/glossarist/non_verbal_entity.rb
|
|
262
|
+
- lib/glossarist/non_verbal_reference.rb
|
|
251
263
|
- lib/glossarist/pronunciation.rb
|
|
252
264
|
- lib/glossarist/rdf.rb
|
|
253
265
|
- lib/glossarist/rdf/gloss_citation.rb
|
|
@@ -290,6 +302,7 @@ files:
|
|
|
290
302
|
- lib/glossarist/schema_migration/v0_to_v1.rb
|
|
291
303
|
- lib/glossarist/schema_migration/v2_to_v3.rb
|
|
292
304
|
- lib/glossarist/section.rb
|
|
305
|
+
- lib/glossarist/shared_non_verbal_entity.rb
|
|
293
306
|
- lib/glossarist/sts.rb
|
|
294
307
|
- lib/glossarist/sts/extracted_designation.rb
|
|
295
308
|
- lib/glossarist/sts/extracted_lang_set.rb
|
|
@@ -298,6 +311,8 @@ files:
|
|
|
298
311
|
- lib/glossarist/sts/importer.rb
|
|
299
312
|
- lib/glossarist/sts/term_extractor.rb
|
|
300
313
|
- lib/glossarist/sts/term_mapper.rb
|
|
314
|
+
- lib/glossarist/table.rb
|
|
315
|
+
- lib/glossarist/table_reference.rb
|
|
301
316
|
- lib/glossarist/transforms.rb
|
|
302
317
|
- lib/glossarist/transforms/concept_to_gloss_transform.rb
|
|
303
318
|
- lib/glossarist/transforms/concept_to_tbx_transform.rb
|
|
@@ -322,8 +337,6 @@ files:
|
|
|
322
337
|
- lib/glossarist/v2/managed_concept_data.rb
|
|
323
338
|
- lib/glossarist/v2/related_concept.rb
|
|
324
339
|
- lib/glossarist/v3.rb
|
|
325
|
-
- lib/glossarist/v3/bibliography_entry.rb
|
|
326
|
-
- lib/glossarist/v3/bibliography_file.rb
|
|
327
340
|
- lib/glossarist/v3/citation.rb
|
|
328
341
|
- lib/glossarist/v3/concept_data.rb
|
|
329
342
|
- lib/glossarist/v3/concept_document.rb
|
|
@@ -331,8 +344,6 @@ files:
|
|
|
331
344
|
- lib/glossarist/v3/concept_source.rb
|
|
332
345
|
- lib/glossarist/v3/configuration.rb
|
|
333
346
|
- lib/glossarist/v3/detailed_definition.rb
|
|
334
|
-
- lib/glossarist/v3/image_entry.rb
|
|
335
|
-
- lib/glossarist/v3/image_file.rb
|
|
336
347
|
- lib/glossarist/v3/localized_concept.rb
|
|
337
348
|
- lib/glossarist/v3/managed_concept.rb
|
|
338
349
|
- lib/glossarist/v3/managed_concept_data.rb
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Glossarist
|
|
4
|
-
module V3
|
|
5
|
-
class BibliographyEntry < Lutaml::Model::Serializable
|
|
6
|
-
attribute :id, :string
|
|
7
|
-
attribute :reference, :string
|
|
8
|
-
attribute :title, :string
|
|
9
|
-
attribute :link, :string
|
|
10
|
-
|
|
11
|
-
key_value do
|
|
12
|
-
map :id, to: :id
|
|
13
|
-
map :reference, to: :reference
|
|
14
|
-
map :title, to: :title
|
|
15
|
-
map :link, to: :link
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Glossarist
|
|
4
|
-
module V3
|
|
5
|
-
class BibliographyFile < Lutaml::Model::Collection
|
|
6
|
-
instances :entries, BibliographyEntry
|
|
7
|
-
|
|
8
|
-
key_value do
|
|
9
|
-
map_instances to: :entries
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
def self.from_file(path)
|
|
13
|
-
return nil unless File.exist?(path)
|
|
14
|
-
|
|
15
|
-
from_yaml(File.read(path))
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def resolve?(anchor)
|
|
19
|
-
entries.any? { |e| e.id == anchor.to_s }
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
def [](key)
|
|
23
|
-
entries.find { |e| e.id == key.to_s }
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Glossarist
|
|
4
|
-
module V3
|
|
5
|
-
class ImageEntry < Lutaml::Model::Serializable
|
|
6
|
-
attribute :id, :string
|
|
7
|
-
attribute :path, :string
|
|
8
|
-
attribute :type, :string, default: -> { "image" }
|
|
9
|
-
attribute :title, :string
|
|
10
|
-
attribute :alt, :string
|
|
11
|
-
|
|
12
|
-
key_value do
|
|
13
|
-
map :id, to: :id
|
|
14
|
-
map :path, to: :path
|
|
15
|
-
map :type, to: :type
|
|
16
|
-
map :title, to: :title
|
|
17
|
-
map :alt, to: :alt
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
end
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Glossarist
|
|
4
|
-
module V3
|
|
5
|
-
class ImageFile < Lutaml::Model::Collection
|
|
6
|
-
instances :entries, ImageEntry
|
|
7
|
-
|
|
8
|
-
key_value do
|
|
9
|
-
map_instances to: :entries
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
def self.from_file(path)
|
|
13
|
-
return nil unless File.exist?(path)
|
|
14
|
-
|
|
15
|
-
from_yaml(File.read(path))
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def path_for_anchor(anchor)
|
|
19
|
-
entries.find { |e| e.id == anchor.to_s }&.path
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
def anchor_for_path(path)
|
|
23
|
-
entries.find { |e| e.path == path }&.id
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def path?(path)
|
|
27
|
-
entries.any? { |e| e.path == path }
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
end
|