Class: Ucode::Coordinator::Indices

Inherits:
Struct
  • Object
show all
Defined in:
lib/ucode/coordinator/indices.rb

Overview

Bag of pre-built indices consumed by the per-codepoint enrichment pass. Every field is a frozen-shaped collection that is read-only after build_indices returns: range files land in sorted Arrays (bsearched by range_first); per-cp files land in flat Hashes keyed by Integer codepoint or by "U+XXXX" id string.

Defined with keyword_init: true so the Coordinator's Indices.new call reads as a self-documenting catalogue of every parsed file — adding a new index is one keyword arg here, one builder call in Coordinator#build_indices, and one assignment in #enrich.

The relationship enumerator (#each_relationship) is the seam the Repo uses to write per-property relationship tables without knowing which Struct field carries which data.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bidi_bracketsObject

Returns the value of attribute bidi_brackets

Returns:

  • (Object)

    the current value of bidi_brackets



35
36
37
# File 'lib/ucode/coordinator/indices.rb', line 35

def bidi_brackets
  @bidi_brackets
end

#bidi_mirroringObject

Returns the value of attribute bidi_mirroring

Returns:

  • (Object)

    the current value of bidi_mirroring



35
36
37
# File 'lib/ucode/coordinator/indices.rb', line 35

def bidi_mirroring
  @bidi_mirroring
end

#binary_propertiesObject

Returns the value of attribute binary_properties

Returns:

  • (Object)

    the current value of binary_properties



35
36
37
# File 'lib/ucode/coordinator/indices.rb', line 35

def binary_properties
  @binary_properties
end

#blocksObject

Returns the value of attribute blocks

Returns:

  • (Object)

    the current value of blocks



35
36
37
# File 'lib/ucode/coordinator/indices.rb', line 35

def blocks
  @blocks
end

#case_foldingObject

Returns the value of attribute case_folding

Returns:

  • (Object)

    the current value of case_folding



35
36
37
# File 'lib/ucode/coordinator/indices.rb', line 35

def case_folding
  @case_folding
end

#cjk_radicalsObject

Returns the value of attribute cjk_radicals

Returns:

  • (Object)

    the current value of cjk_radicals



35
36
37
# File 'lib/ucode/coordinator/indices.rb', line 35

def cjk_radicals
  @cjk_radicals
end

#derived_ageObject

Returns the value of attribute derived_age

Returns:

  • (Object)

    the current value of derived_age



35
36
37
# File 'lib/ucode/coordinator/indices.rb', line 35

def derived_age
  @derived_age
end

#east_asian_widthObject

Returns the value of attribute east_asian_width

Returns:

  • (Object)

    the current value of east_asian_width



35
36
37
# File 'lib/ucode/coordinator/indices.rb', line 35

def east_asian_width
  @east_asian_width
end

#emoji_propertiesObject

Returns the value of attribute emoji_properties

Returns:

  • (Object)

    the current value of emoji_properties



35
36
37
# File 'lib/ucode/coordinator/indices.rb', line 35

def emoji_properties
  @emoji_properties
end

#extra_binary_propertiesObject

Returns the value of attribute extra_binary_properties

Returns:

  • (Object)

    the current value of extra_binary_properties



35
36
37
# File 'lib/ucode/coordinator/indices.rb', line 35

def extra_binary_properties
  @extra_binary_properties
end

#grapheme_breakObject

Returns the value of attribute grapheme_break

Returns:

  • (Object)

    the current value of grapheme_break



35
36
37
# File 'lib/ucode/coordinator/indices.rb', line 35

def grapheme_break
  @grapheme_break
end

#hangul_syllable_typeObject

Returns the value of attribute hangul_syllable_type

Returns:

  • (Object)

    the current value of hangul_syllable_type



35
36
37
# File 'lib/ucode/coordinator/indices.rb', line 35

def hangul_syllable_type
  @hangul_syllable_type
end

#indic_positionalObject

Returns the value of attribute indic_positional

Returns:

  • (Object)

    the current value of indic_positional



35
36
37
# File 'lib/ucode/coordinator/indices.rb', line 35

def indic_positional
  @indic_positional
end

#indic_syllabicObject

Returns the value of attribute indic_syllabic

Returns:

  • (Object)

    the current value of indic_syllabic



35
36
37
# File 'lib/ucode/coordinator/indices.rb', line 35

def indic_syllabic
  @indic_syllabic
end

#line_breakObject

Returns the value of attribute line_break

Returns:

  • (Object)

    the current value of line_break



35
36
37
# File 'lib/ucode/coordinator/indices.rb', line 35

def line_break
  @line_break
end

#name_aliasesObject

Returns the value of attribute name_aliases

Returns:

  • (Object)

    the current value of name_aliases



35
36
37
# File 'lib/ucode/coordinator/indices.rb', line 35

def name_aliases
  @name_aliases
end

#names_listObject

Returns the value of attribute names_list

Returns:

  • (Object)

    the current value of names_list



35
36
37
# File 'lib/ucode/coordinator/indices.rb', line 35

def names_list
  @names_list
end

#property_value_aliasesObject

Returns the value of attribute property_value_aliases

Returns:

  • (Object)

    the current value of property_value_aliases



35
36
37
# File 'lib/ucode/coordinator/indices.rb', line 35

def property_value_aliases
  @property_value_aliases
end

#script_extensionsObject

Returns the value of attribute script_extensions

Returns:

  • (Object)

    the current value of script_extensions



35
36
37
# File 'lib/ucode/coordinator/indices.rb', line 35

def script_extensions
  @script_extensions
end

#scriptsObject

Returns the value of attribute scripts

Returns:

  • (Object)

    the current value of scripts



35
36
37
# File 'lib/ucode/coordinator/indices.rb', line 35

def scripts
  @scripts
end

#sentence_breakObject

Returns the value of attribute sentence_break

Returns:

  • (Object)

    the current value of sentence_break



35
36
37
# File 'lib/ucode/coordinator/indices.rb', line 35

def sentence_break
  @sentence_break
end

#special_casingObject

Returns the value of attribute special_casing

Returns:

  • (Object)

    the current value of special_casing



35
36
37
# File 'lib/ucode/coordinator/indices.rb', line 35

def special_casing
  @special_casing
end

#standardized_variantsObject

Returns the value of attribute standardized_variants

Returns:

  • (Object)

    the current value of standardized_variants



35
36
37
# File 'lib/ucode/coordinator/indices.rb', line 35

def standardized_variants
  @standardized_variants
end

#unihanObject

Returns the value of attribute unihan

Returns:

  • (Object)

    the current value of unihan



35
36
37
# File 'lib/ucode/coordinator/indices.rb', line 35

def unihan
  @unihan
end

#vertical_orientationObject

Returns the value of attribute vertical_orientation

Returns:

  • (Object)

    the current value of vertical_orientation



35
36
37
# File 'lib/ucode/coordinator/indices.rb', line 35

def vertical_orientation
  @vertical_orientation
end

#word_breakObject

Returns the value of attribute word_break

Returns:

  • (Object)

    the current value of word_break



35
36
37
# File 'lib/ucode/coordinator/indices.rb', line 35

def word_break
  @word_break
end

Instance Method Details

#each_relationship {|slug, records| ... } ⇒ Enumerator

Yield (slug, records) for each relationship table. The seam between "what the Coordinator indexed" and "what the Repo writes" lives here — Repo never names a Struct field directly.

Yield Parameters:

  • slug (String)

    output file slug under output/relationships/

  • records (Hash<Integer|String, Record|Array<Record>>)

Returns:

  • (Enumerator)

    when no block is given



72
73
74
75
76
77
78
# File 'lib/ucode/coordinator/indices.rb', line 72

def each_relationship(&block)
  return enum_for(:each_relationship) unless block_given?

  RELATIONSHIPS.each do |slug, field|
    yield(slug, public_send(field))
  end
end