<commit_before>module WhosGotDirt
  module Requests
    module Entity
      # Requests for entities from the LittleSis API.
      #
      # Tokens less than two characters long will be ignored by LittleSis' `q`
      # filter. The `q` parameter matches names and aliases. If `search_all` is
      # `1`, it also matches descriptions and summaries.
      #
      # @example Supply an API key.
      #   "little_sis_api_key": "..."
      #
      # @example Match descriptions and summaries on `name~=` queries.
      #   "search_all": 1
      class LittleSis < Request
        # The JSON response has less metadata, e.g. number of results.
        @base_url = 'https://api.littlesis.org/entities.xml'

        # Returns the URL to request.
        #
        # @return [String] the URL to request
        def to_s
          "#{base_url}?#{to_query(convert)}"
        end

        # Returns the "OR" operator's serialization.
        #
        # @return [String] the "OR" operator's serialization
        def or_operator
          ','
        end

        # Converts the MQL parameters to API-specific parameters.
        #
        # @return [Hash] API-specific parameters
        # @see http://api.littlesis.org/documentation#entities
        # @see http://api.littlesis.org/entities/types.json
        def convert
          match('q', 'name')
          one_of('type_ids', 'classification')
          equal('num', 'limit', default: 100) # default 20
          equal('page', 'page')
<commit_msg>Revert "Have LittleSis return 100 results by default"<commit_after>module WhosGotDirt
  module Requests
    module Entity
      # Requests for entities from the LittleSis API.
      #
      # Tokens less than two characters long will be ignored by LittleSis' `q`
      # filter. The `q` parameter matches names and aliases. If `search_all` is
      # `1`, it also matches descriptions and summaries.
      #
      # @example Supply an API key.
      #   "little_sis_api_key": "..."
      #
      # @example Match descriptions and summaries on `name~=` queries.
      #   "search_all": 1
      class LittleSis < Request
        # The JSON response has less metadata, e.g. number of results.
        @base_url = 'https://api.littlesis.org/entities.xml'

        # Returns the URL to request.
        #
        # @return [String] the URL to request
        def to_s
          "#{base_url}?#{to_query(convert)}"
        end

        # Returns the "OR" operator's serialization.
        #
        # @return [String] the "OR" operator's serialization
        def or_operator
          ','
        end

        # Converts the MQL parameters to API-specific parameters.
        #
        # @return [Hash] API-specific parameters
        # @see http://api.littlesis.org/documentation#entities
        # @see http://api.littlesis.org/entities/types.json
        def convert
          match('q', 'name')
          one_of('type_ids', 'classification')
          equal('num', 'limit') # default 20
          equal('page', 'page')

{'fraction_non_alphanumeric': 0.10438829787234043, 'fraction_numerical': 0.004654255319148936, 'mean_word_length': 2.089322381930185, 'pattern_counts': {'":': 4, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '6952598', 'n_tokens_mistral': 888, 'n_tokens_neox': 859, 'n_words': 269}