<commit_before>module RGreek
  
module Lemma
  def self.included(klass)
    klass.extend(ClassMethods)
    klass.class_eval do
      has_many parses_sym, :foreign_key => "lemma_id"  
    end
  end
  
  module ClassMethods
    include Reflector
    def find_all_lacking_short_def
      self.where("short_def is NULL")
    end
    
    def find_by_parse(parse)
      self.find(parse.lemma_id)
    end
  end#EOM
end#EOM

class GreekLemma < ActiveRecord::Base
  include Lemma
  alias :parses :greek_parses
  
  def lsj_entry
    LsjEntry.find_by_headword(greek_headword)
  end
  
  def to_s
    "#{id}: #{greek_headword} : #{headword} : #{short_def}" 
  end
end#EOC

class LatinLemma < ActiveRecord::Base
  include Lemma
  alias :parses :latin_parses

  def to_s
    "#{id}: #{headword} : #{short_def}" 
  end
end#EOC

end#EOM<commit_msg>DRYed up Lemma<commit_after>module RGreek
  
module Lemma
  def self.included(klass)
    klass.extend(ClassMethods)
    klass.class_eval do
      has_many parses_sym, :foreign_key => "lemma_id"  
      alias_method :parses, parses_sym
    end
  end
  
  module ClassMethods
    include Reflector
    def find_all_lacking_short_def
      self.where("short_def is NULL")
    end
    
    def find_by_parse(parse)
      self.find(parse.lemma_id)
    end
  end#EOM
end#EOM

class GreekLemma < ActiveRecord::Base
  include Lemma
  
  def lsj_entry
    LsjEntry.find_by_headword(greek_headword)
  end
  
  def to_s
    "#{id}: #{greek_headword} : #{headword} : #{short_def}" 
  end
end#EOC

class LatinLemma < ActiveRecord::Base
  include Lemma

  def to_s
    "#{id}: #{headword} : #{short_def}" 
  end
end#EOC

end#EOM
{'fraction_non_alphanumeric': 0.08980582524271845, 'fraction_numerical': 0.0, 'mean_word_length': 3.2282051282051283, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '5971665', 'n_tokens_mistral': 632, 'n_tokens_neox': 616, 'n_words': 132}