<commit_before>#include <memory>
#include <stego-crypt-lib/stego-crypt-lib.hh>

int main(int argc, char* argv[]) {
  Arguments args;
  Error_code err_code = read_args(argc, argv, &args);
  process_error_code(err_code);

  std::unique_ptr<Abstract_embedding_agent> embedder;
  std::unique_ptr<Abstract_extracting_agent> extractor;

  if (args.ftype == File_type::BMP) {
    if (!args.extract) {
      embedder = std::make_unique<BMP_embedding_agent>(args.input_fname,
                                                       args.output_fname);
    } else {
      extractor = std::make_unique<BMP_extracting_agent>(args.input_fname);
    }
    std::cout << "-- Done";
  } else { // args.ftype == File_type::WAV
    /* ***still need to implement WAV embedding and extracting agents
    if (!args.extract) {
      embedder = std::make_unique<WAV_embedding_agent>(args.input_fname,
                                                       args.output_fname);
    } else {
      extractor = std::make_unique<WAV_extracting_agent>(args.input_fname);
    }*/
    std::cout << "WAV files not yet supported\n";
  }

  if (!args.extract) {
    std::string message = message_from_file(args.message_fname);
    embedder->embed_and_save(message);
  } else {
    std::string message = extractor->extract();
    message_to_file(message, args.output_fname);
  }
  return 0;
}<commit_msg>Fix up stego crypt main, it now does everything it will ever need to<commit_after>#include <memory>
#include <stego-crypt-lib/stego-crypt-lib.hh>

int main(int argc, char* argv[]) {
  Arguments args;
  Error_code err_code = read_args(argc, argv, &args);
  process_error_code(err_code);

  File_type file_type = file_type_of(args.input_fname);

  std::unique_ptr<Abstract_embedding_agent> embedder;
  std::unique_ptr<Abstract_extracting_agent> extractor;

  std::cout << "-- Running\n";
  if (!args.extract) {
    print_if("-- Loading the embedding agent\n", args.verbose);
    embedder = which_embedding_agent(file_type, args.input_fname, args.output_fname);

    print_if("-- Loading message from disk\n", args.verbose);
    std::string message = message_from_file(args.message_fname);

    print_if("-- Embedding and saving to disk\n", args.verbose);
    embedder->embed_and_save(message);
  } else {
    print_if("-- Loading the extracting agent\n", args.verbose);
    extractor = which_extracting_agent(file_type, args.input_fname);

    print_if("-- Extracting the message\n", args.verbose);
    std::string message = extractor->extract();

    print_if("-- Saving message to disk\n", args.verbose);
    message_to_file(message, args.output_fname);
  }
  std::cout << "-- Done\n";
  return 0;
}
{'fraction_non_alphanumeric': 0.13278319579894973, 'fraction_numerical': 0.0007501875468867217, 'mean_word_length': 3.551194539249147, 'pattern_counts': {'":': 0, '<': 23, '<?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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5359566', 'n_tokens_mistral': 893, 'n_tokens_neox': 866, 'n_words': 172}