<commit_before>class AutocompleteQuery
  attr_reader :options

  DEFAULT_RESULTS_LIMIT = 1000

  def initialize options = {}
    @options = options
  end

  def self.search options = {}
    new(options).search
  end

  def search
    {
      "meta" => meta_data,
      "results" => results
    }
  end

  private

  def results
    ActiveIngredient.
      where("name LIKE ?", "#{query}%").
      limit(results_limit).
      offset(skip_count).
      order(sort_options)
  end

  def meta_data
    {
      "results" => {
        "limit" => results_limit,
        "total" => ActiveIngredient.count,
        "skip"  => skip_count,
        "count" => results.count,
        "sort"  => sort_options
      }
    }
  end<commit_msg>Fix typo<commit_after>class AutocompleteQuery
  attr_reader :options

  DEFAULT_RESULTS_LIMIT = 1000

  def initialize options = {}
    @options = options
  end

  def self.search options = {}
    new(options).search
  end

  def search
    {
      "meta" => meta_data,
      "results" => results
    }
  end

  private

  def results
    ActiveIngredient.
      name_starts_with(query).
      limit(results_limit).
      offset(skip_count).
      order(sort_options)
  end

  def meta_data
    {
      "results" => {
        "limit" => results_limit,
        "total" => ActiveIngredient.count,
        "skip"  => skip_count,
        "count" => results.count,
        "sort"  => sort_options
      }
    }
  end
{'fraction_non_alphanumeric': 0.10995128740431455, 'fraction_numerical': 0.0055671537926235215, 'mean_word_length': 2.1604395604395603, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, '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': '1188042', 'n_tokens_mistral': 485, 'n_tokens_neox': 458, 'n_words': 96}