<commit_before>require "thor"

module GoogleSearchCriterion
  class CLI < Thor

    desc "compare KEYPHRASE ANOTHER_KEYPHRASE",
         "compares KEYPHRASE against ANOTHER_KEYPHRASE"
    def compare(keyphrase, another_keyphrase)
      puts "#{keyphrase} => #{GoogleSearchCriterion::Search.results(keyphrase)}"
      puts "#{another_keyphrase} => #{GoogleSearchCriterion::Search.results(another_keyphrase)}"
    end

    desc "get KEYPHRASE", "gets results from Google for KEYPHRASE"
    def get(keyphrase)
      puts "#{keyphrase} => #{GoogleSearchCriterion::Search.results(keyphrase)}"
    end
  end
end<commit_msg>Change CLI methods and arguments<commit_after>require "thor"

module GoogleSearchCriterion
  class CLI < Thor

    desc "sort KEYPHRASES",
         "sort KEYPHRASES by Google search results count"
    def sort(*keyphrases)
      keyphrases.map! do |keyphrase|
        { keyphrase: keyphrase,
          results: GoogleSearchCriterion::Search.results(keyphrase) }
      end.sort! { |x, y| y[:results] <=> x[:results]  }

      keyphrases.each do |keyphrase|
        puts "#{keyphrase[:keyphrase]} => #{keyphrase[:results]}"
      end
    end

    desc "get KEYPHRASES", "gets results from Google for KEYPHRASES"
    def get(*keyphrases)
      puts "Nothing to show" if keyphrases.empty?

      keyphrases.each do |keyphrase|
        puts "#{keyphrase} => #{GoogleSearchCriterion::Search.results(keyphrase)}"
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.1096551724137931, 'fraction_numerical': 0.0, 'mean_word_length': 3.6806451612903226, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 9, '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': '5506111', 'n_tokens_mistral': 458, 'n_tokens_neox': 455, 'n_words': 111}