<commit_before>module MDUI
  class KeywordList < Sequel::Model
    many_to_one :ui_info

    def validate
      super
      validates_presence [:ui_info, :lang, :created_at, :updated_at]
    end

    def to_xml_list
      content
    end

    def add(keyword)
      xml_keyword = keyword.sub ' ', '+'
      (self.content += " #{xml_keyword}") && return if content
      self.content = xml_keyword
    end
  end
end<commit_msg>Refine implementation per review comments<commit_after>module MDUI
  class KeywordList < Sequel::Model
    many_to_one :ui_info

    def validate
      super
      validates_presence [:ui_info, :lang, :created_at, :updated_at]
    end

    def to_xml_list
      content
    end

    def add(keyword)
      xml_keyword = keyword.sub ' ', '+'
      self.content = "#{content} #{xml_keyword}".strip
    end
  end
end
{'fraction_non_alphanumeric': 0.09177592371871275, 'fraction_numerical': 0.0, 'mean_word_length': 2.75, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 7}, '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': '7197110', 'n_tokens_mistral': 277, 'n_tokens_neox': 271, 'n_words': 67}