init_tertiary_constants

in lib/twitter_cldr/collation/sort_key_builder.rb [220:257]


      def init_tertiary_constants
        @case_switch = @case_first == :upper ? CASE_SWITCH : NO_CASE_SWITCH

        if @case_first
          @tertiary_mask     = KEEP_CASE_MASK
          @tertiary_addition = TERTIARY_ADDITION_CASE_FIRST

          if @case_first == :upper
            @tertiary_common = TERTIARY_COMMON_UPPER_FIRST
            @tertiary_top    = TERTIARY_TOP_UPPER_FIRST
            @tertiary_bottom = TERTIARY_BOTTOM_UPPER_FIRST
          else 
            @tertiary_common = TERTIARY_COMMON_NORMAL
            @tertiary_top    = TERTIARY_TOP_LOWER_FIRST
            @tertiary_bottom = TERTIARY_BOTTOM_LOWER_FIRST
          end
        else
          @tertiary_mask     = REMOVE_CASE_MASK
          @tertiary_addition = TERTIARY_ADDITION_NORMAL

          @tertiary_common = TERTIARY_COMMON_NORMAL
          @tertiary_top    = TERTIARY_TOP_NORMAL
          @tertiary_bottom = TERTIARY_BOTTOM_NORMAL
        end

        total_tertiary_count   = @tertiary_top - @tertiary_bottom - 1
        @tertiary_top_count    = (TERTIARY_PROPORTION * total_tertiary_count).to_i
        @tertiary_bottom_count = total_tertiary_count - @tertiary_top_count

        @tertiary_common_space = {
            common:       @tertiary_common,
            bottom:       @tertiary_bottom,
            bottom_count: @tertiary_bottom_count,
            top:          @tertiary_top,
            top_count:    @tertiary_top_count
        }
      end