<commit_before># encoding: utf-8

##
# Oedipus Sphinx 2 Search.
# Copyright © 2012 <NAME>.
#
# See LICENSE file for details.
##

module Oedipus
  # Provides an interface for talking to SphinxQL.
  #
  # Currently this class wraps a native mysql extension.
  class Connection
    class << self
      # Quote a value (of any type) for use in SphinxQL.
      #
      # @param [Object] v
      #   the value to quote
      #
      # @return [Object]
      #   the safe value
      #
      # Note that single quotes are added to strings.
      def quote(v)
        require "bigdecimal" unless defined? BigDecimal
        case v
        when BigDecimal, Rational, Complex
          v.to_f
        when Numeric
          v
        when NilClass
          "NULL"<commit_msg>NULL isn't a thing in Sphinx<commit_after># encoding: utf-8

##
# Oedipus Sphinx 2 Search.
# Copyright © 2012 <NAME>.
#
# See LICENSE file for details.
##

module Oedipus
  # Provides an interface for talking to SphinxQL.
  #
  # Currently this class wraps a native mysql extension.
  class Connection
    class << self
      # Quote a value (of any type) for use in SphinxQL.
      #
      # @param [Object] v
      #   the value to quote
      #
      # @return [Object]
      #   the safe value
      #
      # Note that single quotes are added to strings.
      def quote(v)
        require "bigdecimal" unless defined? BigDecimal
        case v
        when BigDecimal, Rational, Complex
          v.to_f
        when Numeric
          v
{'fraction_non_alphanumeric': 0.07360742705570292, 'fraction_numerical': 0.007957559681697613, 'mean_word_length': 1.9646365422396856, 'pattern_counts': {'":': 0, '<': 9, '<?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': '5254196', 'n_tokens_mistral': 467, 'n_tokens_neox': 452, 'n_words': 175}