Class: Ucode::CodeChart::GapAnalyzer::EssenfontManifest
- Defined in:
- lib/ucode/code_chart/gap_analyzer/essenfont_manifest.rb
Overview
Parses the essenfont-style manifest YAML:
ucd_version: "17.0.0"
sources:
- name: noto-sans-sidetic
block: Sidetic
covered_codepoints: ["U+10920", "U+10921"]
- name: lentariso
block: Beria_Erfe
covered_codepoints: ["U+10940"]
Coverage is unioned per block (a block with multiple donor sources has all their codepoints merged before the gap is computed).
Instance Method Summary collapse
Methods inherited from Manifest
Constructor Details
This class inherits a constructor from Ucode::CodeChart::GapAnalyzer::Manifest
Instance Method Details
#coverage_by_block ⇒ Hash{String=>Array<Integer>}
31 32 33 34 35 36 37 38 39 |
# File 'lib/ucode/code_chart/gap_analyzer/essenfont_manifest.rb', line 31 def coverage_by_block sources = parsed.fetch("sources", []) sources.each_with_object({}) do |src, acc| block = src["block"] || (raise ArgumentError, "source missing 'block': #{src.inspect}") cps = Array(src["covered_codepoints"]).map { |s| parse_cp(s) } acc[block] ||= [] acc[block].concat(cps) end end |
#ucd_version ⇒ String
26 27 28 |
# File 'lib/ucode/code_chart/gap_analyzer/essenfont_manifest.rb', line 26 def ucd_version parsed.fetch("ucd_version") end |