<commit_before># encoding: utf-8

require_relative 'input_type_resolver'
require_relative 'cities_text_points'
require_relative 'cities_column_points'

module CartoDB
  module InternalGeocoder

    class QueryGeneratorFactory

      class << self
        private :new

        def get(internal_geocoder, input_type=nil)
          input_type ||= InputTypeResolver.new(internal_geocoder).type

          case input_type
            when [:namedplace, :text, :point]
              CitiesTextPoints.new internal_geocoder
            when [:namedplace, :column, :point]
              CitiesColumnPoints.new internal_geocoder
            else
              raise 'Not implemented'
          end
        end
      end


    end # QueryGeneratorFactory

  end # InternalGeocoder
end #CartoDB<commit_msg>CDB-4232 Add specific exception instead of generic one<commit_after># encoding: utf-8

require_relative 'input_type_resolver'
require_relative 'cities_text_points'
require_relative 'cities_column_points'

module CartoDB
  module InternalGeocoder

    class QueryGeneratorFactory

      class QueryGeneratorNotImplemented < StandardError; end

      class << self
        private :new

        def get(internal_geocoder, input_type=nil)
          input_type ||= InputTypeResolver.new(internal_geocoder).type

          case input_type
            when [:namedplace, :text, :point]
              CitiesTextPoints.new internal_geocoder
            when [:namedplace, :column, :point]
              CitiesColumnPoints.new internal_geocoder
            else
              raise QueryGeneratorNotImplemented. new "QueryGenerator not implemented for input type #{input_type}"
          end
        end
      end


    end # QueryGeneratorFactory

  end # InternalGeocoder
end #CartoDB
{'fraction_non_alphanumeric': 0.05699774266365688, 'fraction_numerical': 0.003386004514672686, 'mean_word_length': 2.7169811320754715, 'pattern_counts': {'":': 0, '<': 8, '<?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': '6891004', 'n_tokens_mistral': 492, 'n_tokens_neox': 474, 'n_words': 119}