glossarist 2.11.0 → 2.11.1
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 +5 -5
- data/lib/glossarist/concept_set.rb +16 -9
- data/lib/glossarist/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: db275fe34501d897cc24b130bf5f0f37a447dc9f440d3aa6a7b0fc1f5ab49051
|
|
4
|
+
data.tar.gz: 29f0e1559a03e9c6c740f6853db1546091ef9aa3acc7b93b091f01ed9ee6fcee
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a281074b57a07df9792775ccbfff3002be6303049979030ccbe7133de46a9ee04a69a807ef3e65eb9aa82c7ff6c62fdc8b00a5182213650d4af5ba6d9cdf8681
|
|
7
|
+
data.tar.gz: bf03d853b4406f6fd42ed3379600d75425058150e0247da46833139085d5752c3fe71b62465b29dcdbad00ee53d72159d7f8a449034e6844bf9f7866a56cd4c1
|
data/CLAUDE.md
CHANGED
|
@@ -19,7 +19,7 @@ All model classes use `Lutaml::Model::Serializable` for serialization.
|
|
|
19
19
|
|
|
20
20
|
### Core Model Hierarchy
|
|
21
21
|
|
|
22
|
-
- **`ManagedConceptCollection`** (`managed_concept_collection.rb`) —
|
|
22
|
+
- **`ManagedConceptCollection`** (`managed_concept_collection.rb`) — legacy enumerable collection of ManagedConcepts. File loading delegates to GlossaryStore via `#load_from_files`; the class is retained as an in-memory accumulator for `STS::Importer` and the legacy `ConceptSet` path. New callers should use GlossaryStore directly.
|
|
23
23
|
- **`ManagedConcept`** (`managed_concept.rb`) — a managed concept with `ManagedConceptData` (groups, localized_concepts map, sources), related concepts, dates, and status. Delegates localization via `add_l10n`/`localization(lang)`.
|
|
24
24
|
- **`Concept`** (`concept.rb`) — base concept with `ConceptData` (definition, terms/designations, notes, examples, sources, dates, language_code). Parent of `LocalizedConcept`.
|
|
25
25
|
- **`LocalizedConcept`** (`localized_concept.rb`) — extends `Concept` with `classification`, `entry_status`, `review_type`.
|
|
@@ -62,9 +62,9 @@ Designation inheritance hierarchy (MECE):
|
|
|
62
62
|
### Dataset Loading
|
|
63
63
|
|
|
64
64
|
- **`GlossaryStore`** (`glossary_store.rb`) — the dataset abstraction. Backed by `Lutaml::Store::PackageStore`, handles loading/saving from directories and ZIPs, concept CRUD, metadata, bibliography, images, dataset-level non-verbal entities (`#figures`, `#tables`, `#formulas` lazy-loaded from `figures/`/`tables/`/`formulas/` subdirectories), and stats. Format detection is model-driven via `ConceptDocument.for_version`. **All callers that need to load concepts from a dataset should use GlossaryStore.**
|
|
65
|
-
- **`ConceptCollector`** (`concept_collector.rb`) — legacy scanner with hand-rolled format detection
|
|
66
|
-
- **`ConceptManager`** (`concept_manager.rb`) — legacy file I/O used by `ManagedConceptCollection`.
|
|
67
|
-
- **`ManagedConceptCollection`** (`managed_concept_collection.rb`) — legacy collection
|
|
65
|
+
- **`ConceptCollector`** (`concept_collector.rb`) — legacy scanner with hand-rolled format detection. No production callers; retained for ABI compatibility. Use GlossaryStore.
|
|
66
|
+
- **`ConceptManager`** (`concept_manager.rb`) — legacy file I/O used by `ManagedConceptCollection#load_from_files`. No direct production callers; retained for the legacy collection path. Use GlossaryStore.
|
|
67
|
+
- **`ManagedConceptCollection`** (`managed_concept_collection.rb`) — legacy collection. File loading delegates to GlossaryStore; retained as an in-memory accumulator for `STS::Importer`. `ConceptSet` now uses GlossaryStore directly (previously went through this collection).
|
|
68
68
|
|
|
69
69
|
### YAML Serialization
|
|
70
70
|
|
|
@@ -183,7 +183,7 @@ Do not attempt to "parameterize" or "collapse" these into the base class:
|
|
|
183
183
|
|
|
184
184
|
See `TODO.improve/` for detailed plans.
|
|
185
185
|
|
|
186
|
-
1. **
|
|
186
|
+
1. **Phase out `ManagedConceptCollection` entirely** — `ConceptSet` now loads via GlossaryStore directly (PR #212). The only remaining user is `STS::Importer`, which uses the collection as an in-memory accumulator after loading via GlossaryStore/GcrPackage. Migrating STS::Importer to a plain Array would close the legacy chapter.
|
|
187
187
|
|
|
188
188
|
### Rejected candidates (do not re-suggest)
|
|
189
189
|
|
|
@@ -4,7 +4,9 @@ require "set"
|
|
|
4
4
|
|
|
5
5
|
module Glossarist
|
|
6
6
|
class ConceptSet
|
|
7
|
-
#
|
|
7
|
+
# An Enumerable of ManagedConcept (Array, GlossaryStore, or
|
|
8
|
+
# ManagedConceptCollection). Set by `read_concepts` based on what
|
|
9
|
+
# the caller passed.
|
|
8
10
|
attr_accessor :concepts
|
|
9
11
|
|
|
10
12
|
# a `BibliographyCollection` object
|
|
@@ -14,8 +16,9 @@ module Glossarist
|
|
|
14
16
|
attr_accessor :assets
|
|
15
17
|
|
|
16
18
|
# @parameters
|
|
17
|
-
# concepts => a
|
|
18
|
-
# a string containing the
|
|
19
|
+
# concepts => an Enumerable of ManagedConcept, a GlossaryStore, a
|
|
20
|
+
# ManagedConceptCollection, or a string containing the
|
|
21
|
+
# path of the dataset directory
|
|
19
22
|
# assets => a collection of Glossarist::Asset
|
|
20
23
|
def initialize(concepts, assets, options = {})
|
|
21
24
|
@concepts = read_concepts(concepts)
|
|
@@ -30,7 +33,7 @@ module Glossarist
|
|
|
30
33
|
def to_latex(filename = nil)
|
|
31
34
|
return to_latex_from_file(filename) if filename
|
|
32
35
|
|
|
33
|
-
|
|
36
|
+
concepts.to_a.map do |concept|
|
|
34
37
|
latex_template(concept)
|
|
35
38
|
end.join("\n")
|
|
36
39
|
end
|
|
@@ -47,12 +50,16 @@ module Glossarist
|
|
|
47
50
|
end.join("\n")
|
|
48
51
|
end
|
|
49
52
|
|
|
53
|
+
# Loads concepts via GlossaryStore when given a path string. Accepts
|
|
54
|
+
# an existing Enumerable (Array, GlossaryStore, ManagedConceptCollection)
|
|
55
|
+
# as-is — callers that already have an in-memory collection can pass
|
|
56
|
+
# it directly without paying for a re-load.
|
|
50
57
|
def read_concepts(concepts)
|
|
51
|
-
return concepts if concepts.is_a?(
|
|
58
|
+
return concepts if concepts.is_a?(Enumerable)
|
|
52
59
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
60
|
+
store = GlossaryStore.new
|
|
61
|
+
store.load(concepts)
|
|
62
|
+
store.concepts
|
|
56
63
|
end
|
|
57
64
|
|
|
58
65
|
def latex_template(concept)
|
|
@@ -76,7 +83,7 @@ module Glossarist
|
|
|
76
83
|
end
|
|
77
84
|
|
|
78
85
|
def concept_map
|
|
79
|
-
@concept_map ||= concepts.
|
|
86
|
+
@concept_map ||= concepts.to_a.to_h do |concept|
|
|
80
87
|
[concept.default_designation.downcase, concept]
|
|
81
88
|
end
|
|
82
89
|
end
|
data/lib/glossarist/version.rb
CHANGED
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.11.
|
|
4
|
+
version: 2.11.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-07-
|
|
11
|
+
date: 2026-07-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: lutaml-model
|