<commit_before>require 'sql_tree'
require 'active_support/core_ext/kernel/reporting'

module SQLTree
  class << self
    attr_accessor :identifier_quote_field_char
  end
  self.identifier_quote_field_char = '`'
end

class SQLTree::Token
  extended_keywords = ['BINARY', 'LIMIT', 'OFFSET', 'INDEX', 'KEY', 'USE', 'FORCE', 'IGNORE']
  KEYWORDS += extended_keywords

  extended_keywords.each do |kwd|
    const_set(kwd, Class.new(SQLTree::Token::Keyword))
  end

  BINARY_ESCAPE = Class.new(SQLTree::Token).new('x')

  def possible_index_hint?
    [SQLTree::Token::USE, SQLTree::Token::FORCE, SQLTree::Token::IGNORE].include?(self.class)
  end

  def index_keyword?
    [SQLTree::Token::INDEX, SQLTree::Token::KEY].include?(self.class)
  end
end

class SQLTree::Tokenizer
  def tokenize_quoted_string(&block) # :yields: SQLTree::Token::String
    string = ''
    until next_char.nil? || current_char == "'"
      string << (current_char == "\\" ? instance_eval("%@\\#{next_char.gsub('@', '\@')}@") : current_char)
    end
    handle_token(SQLTree::Token::String.new(string), &block)<commit_msg>Avoid constant double initialize warning<commit_after>require 'sql_tree'
require 'active_support/core_ext/kernel/reporting'

module SQLTree
  class << self
    attr_accessor :identifier_quote_field_char
  end
  self.identifier_quote_field_char = '`'
end

class SQLTree::Token
  extended_keywords = ['BINARY', 'LIMIT', 'OFFSET', 'INDEX', 'KEY', 'USE', 'FORCE', 'IGNORE']
  KEYWORDS.concat(extended_keywords)

  extended_keywords.each do |kwd|
    const_set(kwd, Class.new(SQLTree::Token::Keyword))
  end

  BINARY_ESCAPE = Class.new(SQLTree::Token).new('x')

  def possible_index_hint?
    [SQLTree::Token::USE, SQLTree::Token::FORCE, SQLTree::Token::IGNORE].include?(self.class)
  end

  def index_keyword?
    [SQLTree::Token::INDEX, SQLTree::Token::KEY].include?(self.class)
  end
end

class SQLTree::Tokenizer
  def tokenize_quoted_string(&block) # :yields: SQLTree::Token::String
    string = ''
    until next_char.nil? || current_char == "'"
      string << (current_char == "\\" ? instance_eval("%@\\#{next_char.gsub('@', '\@')}@") : current_char)
    end
    handle_token(SQLTree::Token::String.new(string), &block)
{'fraction_non_alphanumeric': 0.16395663956639567, 'fraction_numerical': 0.0, 'mean_word_length': 5.401734104046243, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 3, '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': '1681728', 'n_tokens_mistral': 782, 'n_tokens_neox': 763, 'n_words': 128}