<commit_before>module Zhdict
  module CEDict
    DICT_PATH = 'dicts/cedict.txt'

    def self.seed(word_class)
      begin
        dictionary_entry_lines.each_with_index do |line, idx|
          word = word_class.build_from_cedict_line(line)
          word.save
        end
      rescue StandardError => e
        puts "FAILED to parse word ##{idx}:\n#{line}"<commit_msg>print seed index (every 1000)<commit_after>module Zhdict
  module CEDict
    DICT_PATH = 'dicts/cedict.txt'

    def self.seed(word_class)
      begin
        dictionary_entry_lines.each_with_index do |line, idx|
          puts idx if idx % 1000 == 0

          word = word_class.build_from_cedict_line(line)
          word.save
        end
      rescue StandardError => e
        puts "FAILED to parse word ##{idx}:\n#{line}"
{'fraction_non_alphanumeric': 0.0890840652446675, 'fraction_numerical': 0.011292346298619825, 'mean_word_length': 2.5, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2444564', 'n_tokens_mistral': 265, 'n_tokens_neox': 258, 'n_words': 61}