<commit_before>module OpenXml
  module Docx
    module Elements
      class Level < OpenXml::Docx::Element
        include HasChildren, HasProperties
        tag :lvl

        with_namespace :w do
          attribute :level, expects: :integer, displays_as: :ilvl
          attribute :tplc
          attribute :tentative
        end

        value_property :start
        value_property :number_format
        # value_property :lvl_restart
        # value_property :p_style
        # value_property :is_lgl
        # value_property :suff
        value_property :level_text
        # value_property :lvl_pic_bullet_id
        value_property :alignment, as: :level_alignment

        def paragraph_style
          @paragraph_style ||= Paragraph.new
        end

        def character_style
          @character_style ||= Run.new
        end

        def property_xml(xml)
          props = properties.keys.map(&method(:send)).compact
          return if props.none?(&:render?)

          props.each { |prop| prop.to_xml(xml) }
          @paragraph_style.property_xml(xml) unless @paragraph_style.nil?
          @character_style.property_xml(xml) unless @character_style.nil?
        end
      end
    end<commit_msg>Comment out UI attributes in level<commit_after>module OpenXml
  module Docx
    module Elements
      class Level < OpenXml::Docx::Element
        include HasChildren, HasProperties
        tag :lvl

        with_namespace :w do
          attribute :level, expects: :integer, displays_as: :ilvl
          # The following are "UI attributes:" tplc is an entirely opaque
          # Word "template code" and "tenative" just means it wasn't used but
          # was generated anyway.
          # attribute :tplc
          # attribute :tentative
        end

        value_property :start
        value_property :number_format
        # value_property :lvl_restart
        # value_property :p_style
        # value_property :is_lgl
        # value_property :suff
        value_property :level_text
        # value_property :lvl_pic_bullet_id
        value_property :alignment, as: :level_alignment

        def paragraph_style
          @paragraph_style ||= Paragraph.new
        end

        def character_style
          @character_style ||= Run.new
        end

        def property_xml(xml)
          props = properties.keys.map(&method(:send)).compact
          return if props.none?(&:render?)

          props.each { |prop| prop.to_xml(xml) }
          @paragraph_style.property_xml(xml) unless @paragraph_style.nil?
          @character_style.property_xml(xml) unless @character_style.nil?
        end
      end
    end
{'fraction_non_alphanumeric': 0.0720515737580584, 'fraction_numerical': 0.0, 'mean_word_length': 2.2014563106796117, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 16}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '909763', 'n_tokens_mistral': 734, 'n_tokens_neox': 713, 'n_words': 182}