def ratings(str)
      all_valid_cjk(str).map do |enc|
        [
          enc,
          recode(enc, str).codepoints.map do |point|
            Analects::Models::Zi.codepoint_ranges.map.with_index do |range, idx|
              next 6 - idx if range.include?(point)
              0
            end.inject(:+)
          end.inject(:+)
        ]
      end.sort_by(&:last).reverse
    end
def ratings(str)
      all_valid_cjk(str).map do |enc|
        [
          enc,
          recode(enc, str).codepoints.map do |point|
            Analects::Models::Zi.codepoint_ranges.map.with_index do |range, idx|
              next 6 - idx if range.include?(point)
              0
            end.inject(:+)
          end.inject(:+)
        ]
      end.sort_by(&:last).reverse
    end
Crude way to guess which encoding it is