Class: Ucode::Audit::CoverageReference
- Inherits:
-
Object
- Object
- Ucode::Audit::CoverageReference
- Defined in:
- lib/ucode/audit/coverage_reference.rb
Overview
Common interface for any "what is the assigned codepoint set" reference used by the audit pipeline.
Two implementations:
-
UcdOnlyReference — derives the assigned set from the UCD database alone (block ranges). Carries no per-codepoint provenance. This is the legacy behaviour: a font audit compares against the abstract Unicode assigned-codepoint list.
-
UniversalSetReference — derives the assigned set from a universal-set manifest (TODO 24). Every codepoint carries tier + source provenance, so a missing-codepoint report can answer "what does the missing glyph look like, and where did the universal set get it from?".
The audit pipeline (Context → Aggregations extractor → BlockAggregator) talks exclusively to this interface. Adding a new reference kind = one new subclass; no caller changes (open/closed).
Direct Known Subclasses
Defined Under Namespace
Classes: Entry
Instance Method Summary collapse
-
#block_name_for(codepoint) ⇒ String?
Block name (verbatim Unicode identifier, e.g. "Basic_Latin") the codepoint falls under, or nil if it isn't in any known block.
-
#entries_for_block(block_id) ⇒ Array<Entry>
Every assigned codepoint in the block, with tier + source attached when the reference carries provenance.
-
#include?(codepoint) ⇒ Boolean
True if the codepoint is in the reference set.
-
#initialize ⇒ CoverageReference
constructor
A new instance of CoverageReference.
-
#kind ⇒ Symbol
Symbol identifying the reference kind.
-
#provenance_for(codepoints) ⇒ Array<Hash{Symbol=>Object}>?
Provenance rows for a list of codepoints, or nil when the reference carries no provenance (UCD-only).
-
#reference_id ⇒ String
Stable identifier for the reference, embedded in audit reports so consumers can detect drift.
Constructor Details
#initialize ⇒ CoverageReference
Returns a new instance of CoverageReference.
37 |
# File 'lib/ucode/audit/coverage_reference.rb', line 37 def initialize; end |
Instance Method Details
#block_name_for(codepoint) ⇒ String?
Block name (verbatim Unicode identifier, e.g. "Basic_Latin") the codepoint falls under, or nil if it isn't in any known block. Used by BlockAggregator to group a font's cmap by block without needing direct access to the underlying Database.
62 63 64 |
# File 'lib/ucode/audit/coverage_reference.rb', line 62 def block_name_for(codepoint) raise NotImplementedError end |
#entries_for_block(block_id) ⇒ Array<Entry>
Every assigned codepoint in the block, with tier + source attached when the reference carries provenance.
73 74 75 |
# File 'lib/ucode/audit/coverage_reference.rb', line 73 def entries_for_block(block_id) raise NotImplementedError end |
#include?(codepoint) ⇒ Boolean
Returns true if the codepoint is in the reference set.
50 51 52 |
# File 'lib/ucode/audit/coverage_reference.rb', line 50 def include?(codepoint) raise NotImplementedError end |
#kind ⇒ Symbol
Symbol identifying the reference kind. Used by the audit
report's baseline.reference_kind field so consumers know
which reference produced the per-block counts.
44 45 46 |
# File 'lib/ucode/audit/coverage_reference.rb', line 44 def kind raise NotImplementedError end |
#provenance_for(codepoints) ⇒ Array<Hash{Symbol=>Object}>?
Provenance rows for a list of codepoints, or nil when the
reference carries no provenance (UCD-only). Returning nil
(rather than an empty array) is the signal that the audit
report should omit the missing_codepoint_provenance field
entirely — preserving the legacy wire shape for UCD-only
audits.
98 99 100 |
# File 'lib/ucode/audit/coverage_reference.rb', line 98 def provenance_for(codepoints) raise NotImplementedError end |
#reference_id ⇒ String
Stable identifier for the reference, embedded in audit reports so consumers can detect drift. Examples:
"ucd:17.0.0"
"universal-set:17.0.0:abc12345"
84 85 86 |
# File 'lib/ucode/audit/coverage_reference.rb', line 84 def reference_id raise NotImplementedError end |