<commit_before>class Embeddable::RawOtml < ActiveRecord::Base
  set_table_name "embeddable_raw_otmls"

  
  belongs_to :user
  has_many :page_elements, :as => :embeddable
  has_many :pages, :through =>:page_elements
  has_many :teacher_notes, :as => :authored_entity
  
  acts_as_replicatable

  include Changeable

  self.extend SearchableModel
  
  @@searchable_attributes = %w{name description}
  
  class <<self
    def searchable_attributes
      @@searchable_attributes
    end
  end

  default_value_for :name, "Embeddable::RawOtml element"
  default_value_for :description, "A simple OTCompoundDoc example ..."
  default_value_for :otml_content, "<OTCompoundDoc>\n  <bodyText>\n    <div id='content'>Put your content here.</div>\n  </bodyText>\n</OTCompoundDoc>"

  def self.display_name
    "Raw Otml"
  end
  
  def self.authorable_in_java?<commit_msg>creating raw_otml model with valid otml local_id<commit_after>class Embeddable::RawOtml < ActiveRecord::Base
  set_table_name "embeddable_raw_otmls"

  belongs_to :user
  has_many :page_elements, :as => :embeddable
  has_many :pages, :through =>:page_elements
  has_many :teacher_notes, :as => :authored_entity

  def after_create
    self.otml_content = <<-HEREDOC
<OTCompoundDoc local_id='raw_otml_#{self.id}'>
  <bodyText>
    <div id='content'>Put your content here. Make sure you keep this local id on your root object when you change it: local_id='raw_otml_#{self.id}'</div>
  </bodyText>
</OTCompoundDoc>
    HEREDOC
    self.save
  end
  
  acts_as_replicatable

  include Changeable

  self.extend SearchableModel
  
  @@searchable_attributes = %w{name description}
  
  class <<self
    def searchable_attributes
      @@searchable_attributes
    end
  end

  default_value_for :name, "Embeddable::RawOtml element"
  default_value_for :description, "A simple OTCompoundDoc example ..."

  def self.display_name
    "Raw Otml"
  end
  
  def self.authorable_in_java?
{'fraction_non_alphanumeric': 0.09447599380485286, 'fraction_numerical': 0.0, 'mean_word_length': 4.3983286908078, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '3809591', 'n_tokens_mistral': 682, 'n_tokens_neox': 663, 'n_words': 150}